summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-01-13 12:38:48 +0100
committerTor Andersson <tor@ccxvii.net>2024-01-13 12:40:06 +0100
commit28cbf913f44014585768d4f338fc62d4e3dfccc1 (patch)
treed29830c8b19ebecede6582af9576097d953b0e15
parent4f227e1d0ad24aadfc7e1169e4f62f516ec62810 (diff)
downloadserver-28cbf913f44014585768d4f338fc62d4e3dfccc1.tar.gz
Return better error when game does not exist.
-rw-r--r--server.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/server.js b/server.js
index aba9aa3..69b3162 100644
--- a/server.js
+++ b/server.js
@@ -2870,7 +2870,7 @@ wss.on("connection", (socket, req) => {
try {
let game = SQL_SELECT_GAME.get(socket.game_id)
- if (game.title_id !== socket.title_id)
+ if (!game || game.title_id !== socket.title_id)
return socket.close(1000, "Invalid game ID.")
let players = socket.players = SQL_SELECT_PLAYERS_WITH_NAME.all(socket.game_id)