Skip to content

Fix #280 ArgumentNullException from DiscordMessage.MentionedChannels and MentionedRoles

Mateusz Brawański requested to merge github/fork/uwx/patch-74 into master

Created by: uwx

Summary

Fixes #280 (closed): ArgumentNullException from DiscordMessage.MentionedChannels and MentionedRoles

Details

The existing code wrapped a list that would be null in a DM inside a ReadOnlyCollection. The fixed version will return an empty array (which incidentally implements IReadOnlyList since .NET 4.5) instead.

Changes proposed

  • Make _mentionedChannelsLazy and _mentionedRolesLazy return an empty IReadOnlyList when the inner collection is empty

Merge request reports

Loading