Nightly 790/791 breaks EventArgs and/or intents
Created by: VelvetThePanda
Make sure you familiarize yourself with our contributing guidelines.
Summary
When using the latest nightlies (This bug persists in 790 and 791, which changed intents, afaik), trying to access properties that are known to be null (e.g. XEventArgs.Guild
in DMs), the property throws a NullReferenceException
.
Details
Using .NET 5, DSharpPlus version 4.0.0-nightly-00791.
Even if you provide the null propagation operator (?.
), and not accessing any of the null's properties, a NRE is still thrown, as seen below. The EventArgs object is not null, yet trying access the Guild
property at all throws an exception. Interestingly, in DMs, accessing the channel is fine, yet null(?). Not sure if that's intentional behavior?
Steps to reproduce
- Update to 790/791
- Hook into
MessageX'd
and accessXEventArgs.Guild
, but not any of it's properties - Trigger said event on a guild
- Notice normal flow
- Trigger event in DMs
- Observe NRE, even if you don't access
XEventArgs.Guild.Whatever
Notes
I also tested with DiscordIntents.All
, to the same effect. This only applies to DMs, and trying to access the Guild
property of any Event Args.