mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-26 00:38:54 +01:00
check if param exists
This commit is contained in:
parent
ccd7f8e14b
commit
0fc44971a1
1 changed files with 1 additions and 1 deletions
|
@ -214,7 +214,7 @@ app.get("/game-hub", function (req, res) {
|
||||||
var gameslist = ["pong", "tic-tac-toe", "sudoku", "snake"];
|
var gameslist = ["pong", "tic-tac-toe", "sudoku", "snake"];
|
||||||
var requestedGame = req.query.game;
|
var requestedGame = req.query.game;
|
||||||
|
|
||||||
if (!gameslist.includes(requestedGame)) {
|
if (req.query.game && !gameslist.includes(requestedGame)) {
|
||||||
return renderTemplate(res, req, "404.ejs");
|
return renderTemplate(res, req, "404.ejs");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue