Skip to content

Commit

Permalink
Add null check to AllowedMentions.ToModel() (discord-net#1865)
Browse files Browse the repository at this point in the history
  • Loading branch information
d4n3436 authored Nov 23, 2021
1 parent 900c1f4 commit 3cb662f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Discord.Net.Rest/Extensions/EntityExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public static API.Embed ToModel(this Embed entity)

public static API.AllowedMentions ToModel(this AllowedMentions entity)
{
if (entity == null) return null;
return new API.AllowedMentions()
{
Parse = entity.AllowedTypes?.EnumerateMentionTypes().ToArray(),
Expand Down

0 comments on commit 3cb662f

Please sign in to comment.