Fix NRE responding with a modal info class with null required fields (#3114)

This commit is contained in:
Mihail Gribkov
2025-05-08 21:15:12 +03:00
committed by GitHub
parent d0a78d73f9
commit 2b6a9129c9

View File

@@ -70,7 +70,7 @@ namespace Discord.Interactions
{
var boxedValue = textComponent.Getter(modal);
var value = textComponent.TypeOverridesToString
? boxedValue.ToString()
? boxedValue?.ToString()
: boxedValue as string;
builder.AddTextInput(textComponent.Label, textComponent.CustomId, textComponent.Style, textComponent.Placeholder, textComponent.IsRequired ? textComponent.MinLength : null,