Merge pull request #1565 from matrix-org/matthew/group-promise-npe

turn NPE on flair resolution errors into a logged error
pull/21833/head
Matthew Hodgson 2017-11-01 22:18:05 +00:00 committed by GitHub
commit 815b42f0ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -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);
}
});
}