From 7d7cd30e46b3da81821127b5860cd22acf744175 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Wed, 1 Nov 2017 22:10:03 +0000 Subject: [PATCH] turn NPE on flair resolution errors into a logged error --- src/stores/FlairStore.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/stores/FlairStore.js b/src/stores/FlairStore.js index 1ac518a4f6..d848ca7dda 100644 --- a/src/stores/FlairStore.js +++ b/src/stores/FlairStore.js @@ -129,7 +129,11 @@ class FlairStore extends EventEmitter { } const updatedUserGroups = resp.users; usersInFlight.forEach((userId) => { - this._usersPending[userId].resolve(updatedUserGroups[userId] || []); + if (this._usersPending[userId]) { + this._usersPending[userId].resolve(updatedUserGroups[userId] || []); + } else { + console.error("Promise vanished for resolving groups for " + userId); + } }); }