From 28cbf913f44014585768d4f338fc62d4e3dfccc1 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 13 Jan 2024 12:38:48 +0100 Subject: Return better error when game does not exist. --- server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- cgit v1.2.3