From 8b8cf932a3b7c454d27efb2e2eb4a106b50240d7 Mon Sep 17 00:00:00 2001 From: Ske Date: Wed, 22 Jul 2020 00:58:56 +0200 Subject: [PATCH] Add null check in HandlerQueue --- PluralKit.Core/Utils/HandlerQueue.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PluralKit.Core/Utils/HandlerQueue.cs b/PluralKit.Core/Utils/HandlerQueue.cs index abeee1ae..c1238bfc 100644 --- a/PluralKit.Core/Utils/HandlerQueue.cs +++ b/PluralKit.Core/Utils/HandlerQueue.cs @@ -51,7 +51,8 @@ namespace PluralKit.Core public async Task TryHandle(T evt) { - _handlers.RemoveAll(he => !he.Alive); + // Saw spurious NREs in prod indicating `he` is null, add a special check for that for now + _handlers.RemoveAll(he => he == null || !he.Alive); var now = SystemClock.Instance.GetCurrentInstant(); foreach (var entry in _handlers)