From 0c120796c433558df43e2dfc4f5cb7a92990de1e Mon Sep 17 00:00:00 2001 From: Declan Messer Date: Thu, 10 Aug 2023 14:43:09 +0100 Subject: [PATCH] ModifyAsync Attachments Bug Fix #2236 (#2742) * ModifyAsync Attatchment Bug Fix * Resolved UploadWebhookFileParams Bug when passing through null attatchment obj. * Grammar. * Update src/Discord.Net.Rest/Entities/Interactions/InteractionHelper.cs Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com> --------- Co-authored-by: Misha133 <61027276+Misha-133@users.noreply.github.com> Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com> --- .../Entities/Interactions/InteractionHelper.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Discord.Net.Rest/Entities/Interactions/InteractionHelper.cs b/src/Discord.Net.Rest/Entities/Interactions/InteractionHelper.cs index 6241722c77..d412fc41a5 100644 --- a/src/Discord.Net.Rest/Entities/Interactions/InteractionHelper.cs +++ b/src/Discord.Net.Rest/Entities/Interactions/InteractionHelper.cs @@ -480,7 +480,9 @@ public static async Task DeleteFollowupMessageAsync(BaseDiscordClient client, Re } else { - var apiArgs = new UploadWebhookFileParams(args.Attachments.Value.ToArray()) + var attachments = args.Attachments.Value?.ToArray() ?? Array.Empty(); + + var apiArgs = new UploadWebhookFileParams(attachments) { Content = args.Content, Embeds = apiEmbeds?.ToArray() ?? Optional.Unspecified,