Skip to content

Commit 8139986

Browse files
Fix bad type check
Fixes an NRE thrown when an automatic warning is issued for the starting message in a forum post
1 parent a77eeaa commit 8139986

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Helpers/WarningHelpers.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ public static async Task<DiscordMessage> SendPublicWarningMessageAndDeleteInfrin
406406
// Return the sent warning message for logging.
407407

408408
var targetChannel = infringingMessage.Channel;
409-
if (infringingMessage.Channel.Type == DiscordChannelType.GuildForum)
409+
if (infringingMessage.Channel.Type == DiscordChannelType.GuildForum || infringingMessage.Channel.Parent.Type == DiscordChannelType.GuildForum)
410410
{
411411
if (Program.cfgjson.ForumChannelAutoWarnFallbackChannel == 0)
412412
Program.discord.Logger.LogWarning("A warning in forum channel {channelId} was attempted, but may fail due to the fallback channel not being set. Please set 'forumChannelAutoWarnFallbackChannel' in config.json to avoid this.", targetChannel.Id);

0 commit comments

Comments
 (0)