Skip to content

Commit c1dfa22

Browse files
committed
Add parent channel null check to message tracking
1 parent 847ec09 commit c1dfa22

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Events/MessageEvent.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public static async Task MessageHandlerAsync(DiscordClient client, MockDiscordMe
150150

151151
// 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
152152
var channels = JsonConvert.DeserializeObject<List<ulong>>(trackingChannels);
153-
if (trackingChannelsList.Count == 0 || channels.Contains(channel.Id) || channels.Contains(channel.Parent.Id))
153+
if (trackingChannelsList.Count == 0 || channels.Contains(channel.Id) || (channel.Parent is not null && channels.Contains(channel.Parent.Id)))
154154
{
155155
await RelayTrackedMessageAsync(client, message);
156156
}

0 commit comments

Comments
 (0)