diff --git a/src/server/api.ts b/src/server/api.ts index 3d61ac9bd..ff282afa2 100644 --- a/src/server/api.ts +++ b/src/server/api.ts @@ -109,6 +109,8 @@ export const addApiToServer = ({ let numPlayers = parseInt(ctx.request.body.numPlayers); const game = games.find(g => g.name === gameName); + if (!game) ctx.throw(404, 'Game ' + gameName + ' not found'); + const gameID = await CreateGame( db, game,