From cdaeb477a2260846457332c440ad996c3c6bc9c4 Mon Sep 17 00:00:00 2001 From: Azareal Date: Mon, 23 Mar 2020 11:42:42 +1000 Subject: [PATCH] fix x-res topic load bug --- public/global.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/public/global.js b/public/global.js index c19259a6..e9486f8d 100644 --- a/public/global.js +++ b/public/global.js @@ -858,16 +858,18 @@ function mainInit(){ .then(resp => { if(!resp.ok) throw(href+" failed to load"); let xRes = resp.headers.get("x-res") - for(let res of xRes.split(",")) { - let pro; - if(stripQ(getExt(res)) == "css") pro = asyncGetSheet("/s/"+res) - else pro = asyncGetScript("/s/"+res) - pro.then(() => console.log("Loaded " + res)) - .catch(e => { - console.log("Unable to get res '"+res+"'"); - console.log("e",e); - console.trace(); - }); + if(xRes!=null) { + for(let res of xRes.split(",")) { + let pro; + if(stripQ(getExt(res))=="css") pro = asyncGetSheet("/s/"+res) + else pro = asyncGetScript("/s/"+res) + pro.then(() => console.log("Loaded "+res)) + .catch(e => { + console.log("Unable to get '"+res+"'"); + console.log("e",e); + console.trace(); + }); + } } return resp.text(); }).then(data => {