Add check for error condition exposed by misbehaving bot

This commit is contained in:
Calvin Montgomery 2018-04-08 19:19:22 -07:00
parent 976b0a2168
commit bfe0d75278
1 changed files with 8 additions and 0 deletions

View File

@ -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) {