FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

DiscordMember#VoiceState is not marked as nullable, despite being allowed to be null. · Issue #2234 · DSharpPlus/DSharpPlus · GitHub

DiscordMember#VoiceState is not marked as nullable, despite being allowed to be null. #2234

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    epic-nullabilityfor pull requests and issues relating to enabling nullability in v5

    Fields

    Effort

    None yet

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL