diff --git a/src/Discord.Net.Core/Format.cs b/src/Discord.Net.Core/Format.cs index dc2a06540..d9ad43f0d 100644 --- a/src/Discord.Net.Core/Format.cs +++ b/src/Discord.Net.Core/Format.cs @@ -37,8 +37,9 @@ namespace Discord /// Sanitizes the string, safely escaping any Markdown sequences. public static string Sanitize(string text) { - foreach (string unsafeChar in SensitiveCharacters) - text = text.Replace(unsafeChar, $"\\{unsafeChar}"); + if (text != null) + foreach (string unsafeChar in SensitiveCharacters) + text = text.Replace(unsafeChar, $"\\{unsafeChar}"); return text; }