From 76776cdcd40b3c5037a733f353bd59755b56aada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Rynning-T=C3=B8nnesen?= Date: Sat, 3 Mar 2018 15:30:08 +0100 Subject: [PATCH] Fix for crashing server --- server/handlers/list.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/server/handlers/list.js b/server/handlers/list.js index 10ff1ca0..e3e44736 100644 --- a/server/handlers/list.js +++ b/server/handlers/list.js @@ -395,10 +395,12 @@ function send_list(coll, socket, send, list_send, configs, shuffled) if(configs) { - if(conf[0].adminpass !== "") conf[0].adminpass = true; - if(conf[0].hasOwnProperty("userpass") && conf[0].userpass != "") conf[0].userpass = true; - else conf[0].userpass = false; - io.to(coll).emit("conf", conf); + if(conf.length > 0) { + if(conf[0].adminpass !== "") conf[0].adminpass = true; + if(conf[0].hasOwnProperty("userpass") && conf[0].userpass != "") conf[0].userpass = true; + else conf[0].userpass = false; + io.to(coll).emit("conf", conf); + } } }); if(socket){