repo: janusweb
action: commit
revision: 
path_from: 
revision_from: ab95155801a1a273534ffa7cf6b0ad63558be5cb:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit ab95155801a1a273534ffa7cf6b0ad63558be5cb
Author: James Baicoianu 
Date:   Sun Apr 24 00:11:05 2022 -0700

    Gracefully handle missing localStorage

diff --git a/scripts/ui/main.js b/scripts/ui/main.js
index e4ebf78a4684ebcb08b9d6eebf85ec734296d090..
index ..4373759739d6dceee9b02bfb1c40b3e62dc2cfae 100644
--- a/scripts/ui/main.js
+++ b/scripts/ui/main.js
@@ -167,8 +167,12 @@ elation.require(['utils.template', 'elements.elements', 'elements.ui.all', 'elem
     create() {
       var datapath = elation.config.get('janusweb.datapath', '/media/janusweb');
       var configurl = this.config || datapath + (datapath[datapath.length - 1] != '/' ? '/' : '') + 'assets/webui/default.json';
-      this.installedapps = elation.elements.create('collection.localindexed', {index: 'name', storagekey: 'janusweb.ui.installedapps'});
-      this.installedapps.load();
+      try {
+        this.installedapps = elation.elements.create('collection.localindexed', {index: 'name', storagekey: 'janusweb.ui.installedapps'});
+        this.installedapps.load();
+      } catch (e) {
+        this.installedapps = elation.elements.create('collection.indexed', {index: 'name', storagekey: 'janusweb.ui.installedapps'});
+      }
       this.container = elation.elements.create('div', {
         append: this,
         class: 'janus-ui-container'

-----END OF PAGE-----