Skip to content

[BUG] How to handle GuildId when null? (ex. Starting Application from Direct Message) #58

@ETdoFresh

Description

@ETdoFresh

Describe the bug
When starting the app from a direct message, the GuildId is null, which is totally fine. However, the only way for me to access the GuildId is via Dissonity.Api.GuildId. This returns long and not long? ... which causes exception when I try to determine if I'm in a DM.

Web Exception Console Log:
InvalidOperationException: Nullable object must have a value.

Reproduction
Try to access Dissonity.Api.GuildId when running app from a DM.

Expected behavior
Returns a nullable value or at the very least a predefined value (0 or -1 if no guild id exists).

Platform
WebGL (built from Windows)
Unity 2022.3.8f1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingv2Related to Dissonity v2

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions