From 2b6a9129c98974eeb9ad57e5f5d0466018f8f763 Mon Sep 17 00:00:00 2001 From: Mihail Gribkov <61027276+Misha-133@users.noreply.github.com> Date: Thu, 8 May 2025 21:15:12 +0300 Subject: [PATCH] Fix NRE responding with a modal info class with null required fields (#3114) --- .../Extensions/IDiscordInteractionExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Discord.Net.Interactions/Extensions/IDiscordInteractionExtensions.cs b/src/Discord.Net.Interactions/Extensions/IDiscordInteractionExtensions.cs index 37522633..85f53af3 100644 --- a/src/Discord.Net.Interactions/Extensions/IDiscordInteractionExtensions.cs +++ b/src/Discord.Net.Interactions/Extensions/IDiscordInteractionExtensions.cs @@ -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,