Browse Source

fixed null pointer

master
Jeffery R 6 years ago
parent
commit
99b7058e39
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      googletrendsgame/server/server.js

+ 4
- 3
googletrendsgame/server/server.js View File

@ -132,7 +132,7 @@ var room = function(capacityP, pass, owner)
//if room is empty remove the room from rooms list //if room is empty remove the room from rooms list
if(this.users.length == 0) if(this.users.length == 0)
{ {
//rooms[this.roomName] = null;
rooms.remove(this.roomName);
} }
} }
@ -288,7 +288,7 @@ var generateSendRoomsJSON = function()
{ {
console.log("**************"); console.log("**************");
console.log(key); console.log(key);
if(rooms[key] == null)
if(rooms[key] != null)
{ {
var roomObj = new Object(); var roomObj = new Object();
@ -421,7 +421,8 @@ io.on('connection', function(socket)
p.room.removeUser(p); p.room.removeUser(p);
} }
players[p.name] = null;
//players[p.name] = null;
players.remove(p.name);
}); });
}); });

Loading…
Cancel
Save