diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-01-13 12:38:48 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-01-13 12:40:06 +0100 |
commit | 28cbf913f44014585768d4f338fc62d4e3dfccc1 (patch) | |
tree | d29830c8b19ebecede6582af9576097d953b0e15 | |
parent | 4f227e1d0ad24aadfc7e1169e4f62f516ec62810 (diff) | |
download | server-28cbf913f44014585768d4f338fc62d4e3dfccc1.tar.gz |
Return better error when game does not exist.
-rw-r--r-- | server.js | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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) |