From 723724f50beddbe56da04162147c6254e769ab97 Mon Sep 17 00:00:00 2001 From: MatMoul Date: Sun, 21 Oct 2018 04:36:25 +0200 Subject: [PATCH] Bug White page on first install --- src/js/background.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/background.js b/src/js/background.js index 8ba2932..388fb15 100644 --- a/src/js/background.js +++ b/src/js/background.js @@ -102,7 +102,7 @@ app.Messages.init = function(){ // Init Messages Listeners app.Settings = {}; // Settings helper object app.Settings.init = function(callback){ // Load settings and nodes browser.storage.local.get().then(function(data){ - if(Object.keys(data).length == 0) { + if(Object.keys(data).length == 0 || ! data.settings) { data = { version: 3, settings: { @@ -239,6 +239,7 @@ app.Settings.update = function(settings, callback){ // Save new settings app.Settings.save(callback); }; app.Settings.save = function(callback){ // Save settings + if(! app.settings) return; var data = { version: 4 }; data.settings = app.settings; data.node = app.node;