From b5c4587ce9a2cf7c97a53f34d7740affe6485f1b Mon Sep 17 00:00:00 2001 From: Gregg Tavares Date: Sun, 16 Nov 2014 23:26:08 -0800 Subject: [PATCH] make showgames not fail if there's no runtimeInfo --- public/scripts/showgames.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/public/scripts/showgames.js b/public/scripts/showgames.js index 124b11ec..f36bf4ec 100644 --- a/public/scripts/showgames.js +++ b/public/scripts/showgames.js @@ -60,13 +60,16 @@ console.log(obj); for (var ii = 0; ii < obj.length; ++ii) { var game = obj[ii]; var runtimeInfo = game.runtimeInfo; - var hftInfo = runtimeInfo.info.happyFunTimes; - // Not sure how I should figure out the name and screenshot. - var basePath = game.controllerUrl.substring(0, game.controllerUrl.lastIndexOf('/') + 1); - var dev = (runtimeInfo.originalGameId != hftInfo.gameId) ? "(*)" : ""; - game.name = dev + (hftInfo.name || runtimeInfo.originalGameId); - game.screenshotUrl = game.screenshotUrl; - items.push(Strings.replaceParams(template, game)); + if (!runtimeInfo) { + } else { + var hftInfo = runtimeInfo.info.happyFunTimes; + // Not sure how I should figure out the name and screenshot. + var basePath = game.controllerUrl.substring(0, game.controllerUrl.lastIndexOf('/') + 1); + var dev = (runtimeInfo.originalGameId != hftInfo.gameId) ? "(*)" : ""; + game.name = dev + (hftInfo.name || runtimeInfo.originalGameId); + game.screenshotUrl = game.screenshotUrl; + items.push(Strings.replaceParams(template, game)); + } } var html = items.join(""); if (html != oldHtml) {