repo: janusweb
action: commit
revision: 
path_from: 
revision_from: 4e3ee5f741aebc2260437378d97f9f952ea5048b:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit 4e3ee5f741aebc2260437378d97f9f952ea5048b
Author: James Baicoianu 
Date:   Sun Apr 24 00:16:03 2022 -0700

    Gracefully handle missing localStorage

diff --git a/scripts/janusplayer.js b/scripts/janusplayer.js
index 2847f533655f5e466a139e518222a3930d71177d..
index ..6f78a92925ac037bca80f1d4ad8a3daf5e81d857 100644
--- a/scripts/janusplayer.js
+++ b/scripts/janusplayer.js
@@ -18,7 +18,11 @@ elation.require(['engine.things.player', 'janusweb.external.JanusVOIP', 'ui.butt
     this.postinit = function() {
       elation.engine.things.janusplayer.extendclass.postinit.call(this);

-      this.settings = elation.collection.localindexed({storagekey: 'janusweb.player.settings', index: 'key'});
+      try {
+        this.settings = elation.collection.localindexed({storagekey: 'janusweb.player.settings', index: 'key'});
+      } catch (e) {
+        this.settings = elation.collection.indexed({storagekey: 'janusweb.player.settings', index: 'key'});
+      }

       this.defineProperties({
         janus: {type: 'object' },

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