FS-8087 test for valid cache before setting vars

This commit is contained in:
Anthony Minessale
2015-08-28 14:32:48 -05:00
parent 17ee8dde70
commit 1727b457af
2 changed files with 9 additions and 3 deletions

View File

@@ -1106,8 +1106,13 @@ var iceTimer;
if (cached) {
var cache = $.parseJSON(cached);
$.FSRTC.validRes = cache.validRes;
console.log("CACHED RES FOR CAM " + cam, cache);
if (cache) {
$.FSRTC.validRes = cache.validRes;
console.log("CACHED RES FOR CAM " + cam, cache);
} else {
console.error("INVALID CACHE");
}
return func ? func(cache) : null;
}