Add null check to AllowedMentions.ToModel() (#1865)

This commit is contained in:
d4n
2021-11-23 10:49:31 -05:00
committed by GitHub
parent 900c1f4385
commit 3cb662ff7a

View File

@@ -71,6 +71,7 @@ namespace Discord.Rest
public static API.AllowedMentions ToModel(this AllowedMentions entity) public static API.AllowedMentions ToModel(this AllowedMentions entity)
{ {
if (entity == null) return null;
return new API.AllowedMentions() return new API.AllowedMentions()
{ {
Parse = entity.AllowedTypes?.EnumerateMentionTypes().ToArray(), Parse = entity.AllowedTypes?.EnumerateMentionTypes().ToArray(),