From bfe0d75278b3bcf8053a2ce2f47607f2c2cf52d0 Mon Sep 17 00:00:00 2001 From: Calvin Montgomery Date: Sun, 8 Apr 2018 19:19:22 -0700 Subject: [PATCH] Add check for error condition exposed by misbehaving bot --- src/channel/channel.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/channel/channel.js b/src/channel/channel.js index 72a84092..e0f4071d 100644 --- a/src/channel/channel.js +++ b/src/channel/channel.js @@ -369,6 +369,14 @@ Channel.prototype.joinUser = function (user, data) { user.channel = self; user.waitFlag(Flags.U_LOGGED_IN, () => { + if (self.dead) { + LOGGER.warn( + 'Got U_LOGGED_IN for %s after channel already unloaded', + user.getName() + ); + return; + } + if (user.is(Flags.U_REGISTERED)) { db.channels.getRank(self.name, user.getName(), (error, rank) => { if (!error) {