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

fix: Correct if-statement in GameController

parent 6035c1ef
No related branches found
No related tags found
1 merge request!64fix: Correct if-statement in GameController
Pipeline #215645 passed
......@@ -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