From 99b7058e39af9298c226eff9c5952a048fb18fcf Mon Sep 17 00:00:00 2001 From: Jeffery R Date: Sat, 27 Jan 2018 20:49:35 -0500 Subject: [PATCH] fixed null pointer --- googletrendsgame/server/server.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/googletrendsgame/server/server.js b/googletrendsgame/server/server.js index ce9f4e4..6eb858d 100644 --- a/googletrendsgame/server/server.js +++ b/googletrendsgame/server/server.js @@ -132,7 +132,7 @@ var room = function(capacityP, pass, owner) //if room is empty remove the room from rooms list if(this.users.length == 0) { - //rooms[this.roomName] = null; + rooms.remove(this.roomName); } } @@ -288,7 +288,7 @@ var generateSendRoomsJSON = function() { console.log("**************"); console.log(key); - if(rooms[key] == null) + if(rooms[key] != null) { var roomObj = new Object(); @@ -421,7 +421,8 @@ io.on('connection', function(socket) p.room.removeUser(p); } - players[p.name] = null; + //players[p.name] = null; + players.remove(p.name); }); });