mirror of https://github.com/calzoneman/sync.git
Add check for weird setAFK edge case
This commit is contained in:
parent
1e969117c4
commit
29be9233e9
|
@ -2,7 +2,7 @@
|
||||||
"author": "Calvin Montgomery",
|
"author": "Calvin Montgomery",
|
||||||
"name": "CyTube",
|
"name": "CyTube",
|
||||||
"description": "Online media synchronizer and chat",
|
"description": "Online media synchronizer and chat",
|
||||||
"version": "3.51.9",
|
"version": "3.51.10",
|
||||||
"repository": {
|
"repository": {
|
||||||
"url": "http://github.com/calzoneman/sync"
|
"url": "http://github.com/calzoneman/sync"
|
||||||
},
|
},
|
||||||
|
|
15
src/user.js
15
src/user.js
|
@ -242,6 +242,21 @@ User.prototype.setAFK = function (afk) {
|
||||||
this.autoAFK();
|
this.autoAFK();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.inChannel()) {
|
||||||
|
// I haven't exactly nailed down why this.channel can
|
||||||
|
// become null halfway through the function, but based
|
||||||
|
// on log analysis I suspect it's because this.socket.emit()
|
||||||
|
// can fire the "disconnect" event which then tears down
|
||||||
|
// the User object.
|
||||||
|
LOGGER.warn(
|
||||||
|
"Encountered this.channel == null from setAFK. " +
|
||||||
|
"this.dead=%t this.flags=%b",
|
||||||
|
this.dead,
|
||||||
|
this.flags
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Number of AFK users changed, voteskip state changes */
|
/* Number of AFK users changed, voteskip state changes */
|
||||||
if (this.channel.modules.voteskip) {
|
if (this.channel.modules.voteskip) {
|
||||||
this.channel.modules.voteskip.update();
|
this.channel.modules.voteskip.update();
|
||||||
|
|
Loading…
Reference in New Issue