From 46c60ca60748b98ece2a373cd8fd27ae35350402 Mon Sep 17 00:00:00 2001 From: Deon George Date: Mon, 9 Dec 2024 16:12:49 +1100 Subject: [PATCH] If our frame content doesnt exist, treat it as frame not found --- load/page.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/load/page.js b/load/page.js index bb84d8d..24d7317 100644 --- a/load/page.js +++ b/load/page.js @@ -900,7 +900,7 @@ function Page(debug) { var f = new File(filename); if (! f.exists || ! f.open('rb',true)) { log(LOG_ERROR,'|? File doesnt exist: ['+filename+']'); - return false; + return undefined; } var content = f.read(); @@ -958,7 +958,6 @@ function Page(debug) { log(LOG_ERROR,'|? File doesnt exist: ['+filename+']'); return false; } - var contents = JSON.parse(f.read()); contents.date = f.date; f.close(); @@ -967,6 +966,10 @@ function Page(debug) { if (contents.version === 2) contents.content = this.file_content(FRAMES_HOME+SESSION_EXT+'/'+this.name.toString()+'.'+CONTENT_EXT); + // The content file doesnt exist + if (contents.content === undefined) + return false; + var valid_sauce = false; if (contents.content.substr(-128, 7) === 'SAUCE00') {