Fixes a bug where users spamming join and rejoin can sometimes cause the UI to request leaving a gather the user is no longer a member of resulting in a crash due to null dereference.

See https://www.ensl.org/bans/879
This commit is contained in:
ArturPhilibin 2020-02-12 00:01:20 +00:00
parent 8ce1306b05
commit c2f25eece7

View file

@ -163,6 +163,12 @@ module.exports = function (namespace) {
const removeGatherer = (gather, user) => {
let gatherLeaver = gather.getGatherer(user);
if (!gatherLeaver) {
winston.info(`${user.username} ${user.id} attempted to leave ${gather.type} gather, but was not in gather.`);
return;
}
if (gather.can("removeGatherer")) {
gather.removeGatherer(user);
}