From 20addea98642295669fe3a1b116bfa23f381aa0b Mon Sep 17 00:00:00 2001 From: Ske Date: Sun, 30 Aug 2020 15:53:03 +0200 Subject: [PATCH] Ignore reactions on channels we don't have cached --- PluralKit.Bot/Handlers/ReactionAdded.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PluralKit.Bot/Handlers/ReactionAdded.cs b/PluralKit.Bot/Handlers/ReactionAdded.cs index 5fac7357..5abc5840 100644 --- a/PluralKit.Bot/Handlers/ReactionAdded.cs +++ b/PluralKit.Bot/Handlers/ReactionAdded.cs @@ -34,7 +34,7 @@ namespace PluralKit.Bot private async ValueTask TryHandleProxyMessageReactions(MessageReactionAddEventArgs evt) { // Only proxies in guild text channels - if (evt.Channel.Type != ChannelType.Text) return; + if (evt.Channel == null || evt.Channel.Type != ChannelType.Text) return; // Sometimes we get events from users that aren't in the user cache // In that case we get a "broken" user object (where eg. calling IsBot throws an exception)