Fix undefined dereference in rank callback

This commit is contained in:
Calvin Montgomery 2018-07-25 21:27:28 -07:00
parent 67b1c97d89
commit 878b30bdb2

View file

@ -79,7 +79,9 @@ PollModule.prototype.onUserPostJoin = function (user) {
this.addUserToPollRoom(user);
const self = this;
user.on("effectiveRankChange", () => {
self.addUserToPollRoom(user);
if (self.channel && !self.channel.dead) {
self.addUserToPollRoom(user);
}
});
};