diff --git a/src/routes/game/start.js b/src/routes/game/start.js index f47a63b..2bcc564 100644 --- a/src/routes/game/start.js +++ b/src/routes/game/start.js @@ -14,7 +14,7 @@ function getGameById(id) { } app.get("/:id", async (request, response) => { - const game = global.games.get(getGameById(request.params.id).id) + const game = global.games.get(getGameById(request.params.id)?.id) if (game) return response.status(400).json({ error: "Game is running" }) const job = new GameJob()