Skip to content

Commit

Permalink
Fix emoto try parse (discord-net#1941)
Browse files Browse the repository at this point in the history
  • Loading branch information
quinchs authored Nov 23, 2021
1 parent 933ea42 commit 900c1f4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Discord.Net.Core/Entities/Emotes/Emote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 900c1f4

Please sign in to comment.