Skip to content

MessageComponent: Add better json type exception#3176

Merged
Misha-133 merged 1 commit into
discord-net:devfrom
adamgauthier:componentjsonerror
Aug 14, 2025
Merged

MessageComponent: Add better json type exception#3176
Misha-133 merged 1 commit into
discord-net:devfrom
adamgauthier:componentjsonerror

Conversation

@adamgauthier

Copy link
Copy Markdown
Contributor

Description

Currently in MessageComponentConverter, the error on unknown type is System.ArgumentNullException: Value cannot be null. (Parameter 'target')

This is because PopulateObject() doesn't allow a null target, but we don't have a default case on the switch statement.

Changes

Add a default case with a better exception when this situation happens.

Currently in MessageComponentConverter, the error on unknown type is
System.ArgumentNullException: Value cannot be null. (Parameter 'target')

This is because PopulateObject() doesn't allow a null target, but we
don't have a default case on the switch statement.
@Misha-133 Misha-133 merged commit ae6e7d5 into discord-net:dev Aug 14, 2025
2 checks passed
@adamgauthier adamgauthier deleted the componentjsonerror branch May 23, 2026 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants