Nightly 790/791 breaks EventArgs and/or intentsSee original GitHub issue
Make sure you familiarize yourself with our contributing guidelines.
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
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
XEventArgs.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
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.
Expected behavior / pre-790
Behavior expressed in 790/791
- Created 3 years ago
- Comments:5 (5 by maintainers)