Trying small fix for null-viewers bug

This commit is contained in:
Kasper Rynning-Tønnesen
2017-09-12 17:43:31 +02:00
parent e8ed8fa815
commit 253b5d75d9
2 changed files with 10 additions and 2 deletions

View File

@@ -41,7 +41,11 @@ var list = function(msg, guid, coll, offline, socket) {
socket.join(coll);
Functions.check_inlist(coll, guid, socket, offline);
io.to(coll).emit("viewers", frontpage_lists.viewers);
if(frontpage_lists.viewers != undefined){
io.to(coll).emit("viewers", frontpage_lists.viewers);
} else {
io.to(coll).emit("viewers", 1);
}
send_list(coll, socket, true, false, true);