Merge pull request #156 from ArturPhilibin/bugfix/lebra_leave_join_spam_crash

Fixes a bug where users spamming join and rejoin can sometimes cause …
This commit is contained in:
Absurdon 2020-02-13 21:08:02 +01:00 committed by GitHub
commit a9917096c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -183,6 +183,11 @@ 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);
}