Try to fix 504 timeout error
authorBenjamin Auder <benjamin.auder@somewhere>
Sun, 9 Feb 2020 20:16:36 +0000 (21:16 +0100)
committerBenjamin Auder <benjamin.auder@somewhere>
Sun, 9 Feb 2020 20:16:36 +0000 (21:16 +0100)
server/models/Game.js

index 79bf071..32b2a66 100644 (file)
@@ -138,7 +138,8 @@ const GameModel =
       db.all(query, (err,gameIds) => {
         if (!!err)
           return cb(err);
-        gameIds = gameIds || []; //might be empty
+        if (gameIds.length == 0)
+          return cb(null, []);
         let gameArray = [];
         for (let i=0; i<gameIds.length; i++)
         {