From 80398bfad9e2f99dd390794f381315c496405211 Mon Sep 17 00:00:00 2001 From: Erisa A Date: Sun, 28 Jul 2024 20:17:06 +0100 Subject: [PATCH] Log an error if a deleted message is null --- Events/MessageEvent.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Events/MessageEvent.cs b/Events/MessageEvent.cs index 786fa224..caffe35d 100644 --- a/Events/MessageEvent.cs +++ b/Events/MessageEvent.cs @@ -32,7 +32,8 @@ public static async Task MessageDeleted(DiscordClient client, MessageDeletedEven { if (e.Message is null) { - client.Logger.LogDebug("Got a message delete event but the message was null!"); + client.Logger.LogError("Got a message delete event but the message was null!"); + return; } else if (e.Message.Author is null) { client.Logger.LogDebug("Got a message delete event for a message with no author: {message}", DiscordHelpers.MessageLink(e.Message));