As the title says, DiscordMember#VoiceState is not marked as nullable ? but it can be.
|
=> this.Discord.Guilds[this.guild_id].VoiceStates.TryGetValue(this.Id, out DiscordVoiceState? voiceState) ? voiceState : null; |
Since it isn't shown as nullable I assumed that I could safely access VoiceState and that the actual Channel property safely to check if the member is connected somewhere, which resulted in a NullReferenceException.
It would be cool if it could be marked as nullable
Reactions are currently unavailable
As the title says, DiscordMember#VoiceState is not marked as nullable ? but it can be.
DSharpPlus/DSharpPlus/Entities/Guild/DiscordMember.cs
Line 158 in 865c42e
Since it isn't shown as nullable I assumed that I could safely access VoiceState and that the actual Channel property safely to check if the member is connected somewhere, which resulted in a NullReferenceException.
It would be cool if it could be marked as nullable