From 900c1f4385a66fe0e190a92edf05c434b3fd5838 Mon Sep 17 00:00:00 2001 From: Quin Lynch <49576606+quinchs@users.noreply.github.com> Date: Tue, 23 Nov 2021 11:46:18 -0400 Subject: [PATCH] Fix emoto try parse (#1941) --- src/Discord.Net.Core/Entities/Emotes/Emote.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Discord.Net.Core/Entities/Emotes/Emote.cs b/src/Discord.Net.Core/Entities/Emotes/Emote.cs index cd88f97cc7..3a8cd7457d 100644 --- a/src/Discord.Net.Core/Entities/Emotes/Emote.cs +++ b/src/Discord.Net.Core/Entities/Emotes/Emote.cs @@ -74,6 +74,10 @@ public static Emote Parse(string text) public static bool TryParse(string text, out Emote result) { result = null; + + if (text == null) + return false; + if (text.Length >= 4 && text[0] == '<' && (text[1] == ':' || (text[1] == 'a' && text[2] == ':')) && text[text.Length - 1] == '>') { bool animated = text[1] == 'a';