Skip to content
Snippets Groups Projects
Commit 324742f0 authored by Sander Østrem Fagernes's avatar Sander Østrem Fagernes
Browse files

Merge branch 'fix-backend-poll-for-lobby-crash' into 'main'

fix: Correct if-statement in GameController

See merge request !64
parents 6035c1ef a816781e
No related branches found
No related tags found
1 merge request!64fix: Correct if-statement in GameController
Pipeline #215656 passed with stages
in 2 minutes and 22 seconds
......@@ -12,7 +12,7 @@ const gameHandler = GameHandler.getInstance();
// endpoint to get current gameId of a lobby
export const gameId = async (req: Request, res: Response): Promise<void> => {
const lobby = gameHandler.getLobbyById(parseInt(req.params.lobbyId));
if (lobby) {
if (lobby?.getGameId()) {
res.status(200).send(lobby.getGameId());
} else {
res.status(404).send('Lobby does not have ongoing game');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment