Add null check to AllowedMentions.ToModel() (#1865)
This commit is contained in:
@@ -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(),
|
||||||
|
|||||||
Reference in New Issue
Block a user