From 99f12ac0a1dc9633db08bf2804d7920d060fc214 Mon Sep 17 00:00:00 2001
From: Benjamin Auder <benjamin.auder@somewhere>
Date: Sun, 9 Feb 2020 21:16:36 +0100
Subject: [PATCH] Try to fix 504 timeout error

---
 server/models/Game.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/server/models/Game.js b/server/models/Game.js
index 79bf071f..32b2a662 100644
--- a/server/models/Game.js
+++ b/server/models/Game.js
@@ -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++)
         {
-- 
2.44.0