Minor bugfixes

This commit is contained in:
calzoneman 2013-12-17 23:07:01 -05:00
parent 31368cfe7f
commit 10de5df3c6
2 changed files with 11 additions and 1 deletions

View file

@ -818,6 +818,10 @@ Channel.prototype.addPendingJoin = function (user, password) {
Channel.prototype.handlePendingJoins = function () { Channel.prototype.handlePendingJoins = function () {
var self = this; var self = this;
if (self.dead) {
return;
}
self.pendingJoins.forEach(function (u) { self.pendingJoins.forEach(function (u) {
self.userJoin(u.user, u.pw); self.userJoin(u.user, u.pw);
}); });
@ -871,6 +875,12 @@ Channel.prototype.userJoin = function(user, password) {
// Prevent duplicate login // Prevent duplicate login
if(user.name != "") { if(user.name != "") {
if (this.users === undefined) {
Logger.errlog.log("Wat: this.users is undefined");
Logger.errlog.log("chan: " + this.name + ", dead: " + this.dead);
Logger.errlog.log("keys: " + Object.keys(this).join(","));
return;
}
for(var i = 0; i < this.users.length; i++) { for(var i = 0; i < this.users.length; i++) {
if(this.users[i].name.toLowerCase() == user.name.toLowerCase()) { if(this.users[i].name.toLowerCase() == user.name.toLowerCase()) {
if (this.users[i] == user) { if (this.users[i] == user) {

View file

@ -121,7 +121,7 @@ var Server = function (cfg) {
"path-traversal", "path-traversal",
req.url); req.url);
} else if (e.status >= 500) { } else if (e.status >= 500) {
Logger.errlog.log(err); Logger.errlog.log(e);
} }
res.send(e.status); res.send(e.status);
} else { } else {