Fix a typo and an undefined variable case

This commit is contained in:
calzoneman 2014-04-08 18:06:37 -05:00
parent 5c9c096209
commit 324fa6c81a
2 changed files with 2 additions and 2 deletions

View File

@ -97,7 +97,7 @@ function handleConnection(sock) {
Logger.syslog.log("Accepted socket from " + ip);
var user = new User(sock);
if (sock.handshake.user) {
if (sock.handshake && sock.handshake.user) {
user.name = sock.handshake.user.name;
user.global_rank = sock.handshake.user.global_rank;
user.loggedIn = true;

View File

@ -496,7 +496,7 @@ User.prototype.login = function (name, pw) {
if (err) {
if (err === "Invalid username/password combination") {
Logger.eventlog.log("[loginfail] Login failed (bad password): " + name
+ "@" + user.ip);
+ "@" + self.ip);
}
self.socket.emit("login", {