Browse Source

Fix null ex

pull/1923/head
quin lynch 4 years ago
parent
commit
31278377cd
1 changed files with 16 additions and 14 deletions
  1. +16
    -14
      src/Discord.Net.Rest/API/Common/ButtonComponent.cs

+ 16
- 14
src/Discord.Net.Rest/API/Common/ButtonComponent.cs View File

@@ -42,23 +42,25 @@ namespace Discord.API
this.Url = c.Url;
this.Disabled = c.Disabled;

if (c.Emote is Emote e)
if (c.Emote != null)
{
this.Emote = new Emoji()
if (c.Emote is Emote e)
{
Name = e.Name,
Animated = e.Animated,
Id = e.Id,
};
}
else
{
this.Emote = new Emoji()
this.Emote = new Emoji()
{
Name = e.Name,
Animated = e.Animated,
Id = e.Id,
};
}
else
{
Name = c.Emote.Name
};
}

this.Emote = new Emoji()
{
Name = c.Emote.Name
};
}
}
}
}
}

Loading…
Cancel
Save