From c3d34c80112b291f13375b477e4fb6d70b59ed0a Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 12 Jan 2022 13:44:52 +0100 Subject: Tweak replay access links and gracefully handle broken replay logs. --- server.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'server.js') diff --git a/server.js b/server.js index d1f6ac8..b1aa38f 100644 --- a/server.js +++ b/server.js @@ -1405,10 +1405,8 @@ app.get('/replay/:game_id', function (req, res) { if (game.status < 2) return res.status(404).send("Invalid game ID."); let players = SQL_SELECT_PLAYERS_JOIN.all(game_id); - let replay = SQL_SELECT_REPLAY.all(game_id); - if (replay.length > 0) - return res.json({players, replay}); let state = SQL_SELECT_GAME_STATE.get(game_id); + let replay = SQL_SELECT_REPLAY.all(game_id); return res.json({players, state, replay}); }); -- cgit v1.2.3