mirror of https://github.com/calzoneman/sync.git
Fix a typo and an undefined variable case
This commit is contained in:
parent
5c9c096209
commit
324fa6c81a
|
@ -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;
|
||||
|
|
|
@ -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", {
|
||||
|
|
Loading…
Reference in New Issue