Skip to content

Commit

Permalink
Add parent channel null check to message tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
Erisa committed Jan 22, 2025
1 parent 847ec09 commit c1dfa22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Events/MessageEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public static async Task MessageHandlerAsync(DiscordClient client, MockDiscordMe

// Relay if this user's tracking is not filtered to any channels, or if this msg is in a channel the tracking is filtered to
var channels = JsonConvert.DeserializeObject<List<ulong>>(trackingChannels);
if (trackingChannelsList.Count == 0 || channels.Contains(channel.Id) || channels.Contains(channel.Parent.Id))
if (trackingChannelsList.Count == 0 || channels.Contains(channel.Id) || (channel.Parent is not null && channels.Contains(channel.Parent.Id)))
{
await RelayTrackedMessageAsync(client, message);
}
Expand Down

0 comments on commit c1dfa22

Please sign in to comment.