mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2025-01-31 13:30:37 +00:00
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:
parent
8ce1306b05
commit
c2f25eece7
1 changed files with 6 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue