diff --git a/DiscordLab.Administration/Patches/ErrorLog.cs b/DiscordLab.Administration/Patches/ErrorLog.cs index 02d879f..9c14fd5 100644 --- a/DiscordLab.Administration/Patches/ErrorLog.cs +++ b/DiscordLab.Administration/Patches/ErrorLog.cs @@ -31,7 +31,7 @@ public static void Postfix(object message) MemoryStream stream = new MemoryStream(); StreamWriter writer = new StreamWriter(stream); - writer.Write(message.ToString()); + writer.Write(message?.ToString() ?? "Null error message"); writer.Flush(); stream.Position = 0; @@ -55,4 +55,4 @@ public static void Postfix(object message) } }); } -} \ No newline at end of file +} diff --git a/DiscordLab.Bot/Commands/DiscordCommand.cs b/DiscordLab.Bot/Commands/DiscordCommand.cs index 6e1163f..ac4b555 100644 --- a/DiscordLab.Bot/Commands/DiscordCommand.cs +++ b/DiscordLab.Bot/Commands/DiscordCommand.cs @@ -158,4 +158,4 @@ await autocomplete.RespondAsync(Module.CurrentModules .Where(x => x.Name != "DiscordLab.Bot" && x.Name.Contains((string)autocomplete.Data.Current.Value)).Take(25) .Select(x => new AutocompleteResult($"{x.Name} (v{x.Version})", x.Name))); } -} \ No newline at end of file +}