Discord-Net-Labs / Discord.Net-Labs

An experimental fork of Discord.Net that implements the newest discord features for testing and development to eventually get merged into Discord.Net
https://labs.discordnet.dev
MIT License
156 stars 42 forks source link

Context.Interaction.RespondAsync throwing Object reference not set to an instance of an Object if no text is supplied #347

Closed TheStachelfisch closed 2 years ago

TheStachelfisch commented 2 years ago

Description

When calling RespondAsync() in an SocketInteractionContext and no text: "" is supplied in RespondAsync() it will throw Object reference not set to an instance of an object.. When supplying String.Empty for the text parameter it will not throw an exception

Stack trace:

Error -> Unknown : Object reference not set to an instance of an object.
   at Discord.Rest.MessageHelper.ParseTags(String text, IMessageChannel channel, IGuild guild, IReadOnlyCollection`1 userMentions) in D:\RiderProjects\REDACTED\Discord.Net.Labs\src\Discord.Net.Rest\Entities\Messages\MessageHelper.cs:line 267
   at Discord.Rest.RestUserMessage.Update(Message model) in D:\RiderProjects\REDACTED\Discord.Net.Labs\src\Discord.Net.Rest\Entities\Messages\RestUserMessage.cs:line 109
   at Discord.Rest.RestInteractionMessage.Update(InteractionResponse model, IDiscordInteraction interaction) in D:\RiderProjects\REDACTED\Discord.Net.Labs\src\Discord.Net.Rest\Entities\Messages\RestInteractionMessage.cs:line 44
   at Discord.Rest.RestInteractionMessage.Create(BaseDiscordClient discord, InteractionResponse model, IDiscordInteraction interaction, IMessageChannel channel) in D:\RiderProjects\REDACTED\Discord.Net.Labs\src\Discord.Net.Rest\Entities\Messages\RestInteractionMessage.cs:line 32
   at Discord.Rest.InteractionHelper.SendInteractionResponseAsync(BaseDiscordClient client, InteractionResponse response, IDiscordInteraction interaction, IMessageChannel channel, RequestOptions options) in D:\RiderProjects\REDACTED\Discord.Net.Labs\src\Discord.Net.Rest\Entities\Interactions\InteractionHelper.cs:line 41
   at Discord.WebSocket.SocketCommandBase.RespondAsync(String text, Embed[] embeds, Boolean isTTS, Boolean ephemeral, AllowedMentions allowedMentions, MessageComponent component, Embed embed, RequestOptions options) in D:\RiderProjects\REDACTED\Discord.Net.Labs\src\Discord.Net.WebSocket\Entities\Interaction\SocketBaseCommand\SocketCommandBase.cs:line 136

   at Discord.Interactions.Builders.ModuleClassBuilder.<>c__DisplayClass10_0.<<CreateCallback>g__ExecuteCallback|1>d.MoveNext() in D:\RiderProjects\REDACTED\Discord.Net.Labs\src\Discord.Net.Interactions\Builders\ModuleClassBuilder.cs:line 323

Steps to reproduce