diff --git a/DisCatSharp/Entities/Message/DiscordMessage.cs b/DisCatSharp/Entities/Message/DiscordMessage.cs index 3f776302eb..9a3f6e9bf8 100644 --- a/DisCatSharp/Entities/Message/DiscordMessage.cs +++ b/DisCatSharp/Entities/Message/DiscordMessage.cs @@ -478,15 +478,20 @@ private List GetMentions() { var mentions = new List(); - if (this.ReferencedMessage != null && this.MentionedUsersInternal.Contains(this.ReferencedMessage.Author)) - mentions.Add(new RepliedUserMention()); + try + { + if (this.ReferencedMessage is not null && this.MentionedUsersInternal && this.MentionedUsersInternal.Contains(this.ReferencedMessage.Author)) + mentions.Add(new RepliedUserMention()); - if (this.MentionedUsersInternal.Count != 0) - mentions.AddRange(this.MentionedUsersInternal.Select(m => (IMention)new UserMention(m))); - - if (this.MentionedRoleIds.Count != 0) - mentions.AddRange(this.MentionedRoleIds.Select(r => (IMention)new RoleMention(r))); + if (this.MentionedUsersInternal.Count != 0) + mentions.AddRange(this.MentionedUsersInternal.Select(m => (IMention)new UserMention(m))); + if (this.MentionedRoleIds.Count != 0) + mentions.AddRange(this.MentionedRoleIds.Select(r => (IMention)new RoleMention(r))); + } + catch + { } + return mentions; }