From 45b7f939d03f7c73850dbc3319d1638a00909579 Mon Sep 17 00:00:00 2001 From: itsCristianPro7 Date: Fri, 19 Jul 2024 21:44:36 -0600 Subject: [PATCH] fix: incomplete validation when ChannelFlags.RequireTag is true --- src/Discord.Net.Rest/Entities/Channels/ThreadHelper.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Discord.Net.Rest/Entities/Channels/ThreadHelper.cs b/src/Discord.Net.Rest/Entities/Channels/ThreadHelper.cs index cbfd611469..a133211d8e 100644 --- a/src/Discord.Net.Rest/Entities/Channels/ThreadHelper.cs +++ b/src/Discord.Net.Rest/Entities/Channels/ThreadHelper.cs @@ -213,7 +213,9 @@ public static async Task CreatePostAsync(IForumChannel channe throw new ArgumentException("The only valid MessageFlags are SuppressEmbeds and none.", nameof(flags)); if (channel.Flags.HasFlag(ChannelFlags.RequireTag)) - throw new ArgumentException($"The channel {channel.Name} requires posts to have at least one tag."); + { + Preconditions.AtLeast(tagIds?.Length ?? 0, 1, nameof(tagIds), $"The channel {channel.Name} requires posts to have at least one tag."); + } var args = new CreateMultipartPostAsync(attachments.ToArray()) {