From bebcfdd9596ca90f9c1ca210a68569b767fdfbce Mon Sep 17 00:00:00 2001 From: mveril Date: Tue, 8 Dec 2020 15:04:40 +0100 Subject: [PATCH] Fix null array in yaml (#13) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix broken link * Fix bug in indexDB * Fix sourceFile for each geometry * Fix null array in yaml Co-authored-by: Mickaël Véril --- static/js/indexDB.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/static/js/indexDB.js b/static/js/indexDB.js index 0e123cf5..05d6185d 100644 --- a/static/js/indexDB.js +++ b/static/js/indexDB.js @@ -8,9 +8,9 @@ class indexDB { var site_url = "/"+window.location.pathname.split('/')[1]; const text = await getTextFromFileUrlAsync(site_url+"/data/index.yaml",{"Cache-Control":`max-age=${maxAge}`}) const myYaml = jsyaml.load(text); - db.sets = ((myYaml.sets === undefined) ? new Map() : new Map(Object.entries(myYaml.sets))); - db.others = ((myYaml.others === undefined) ? [] : Array.from(myYaml.others)); - db.reviews = ((myYaml.reviews === undefined) ? [] : Array.from(myYaml.reviews)); + db.sets = ((myYaml.sets == null) ? new Map() : new Map(Object.entries(myYaml.sets))); + db.others = ((myYaml.others == null) ? [] : Array.from(myYaml.others)); + db.reviews = ((myYaml.reviews == null) ? [] : Array.from(myYaml.reviews)); window.indexDB=db return db }