From dd190155c4aec1d1550517525554c53b10eceef3 Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Sun, 7 Jan 2018 23:16:55 +1100 Subject: Empty storage fix --- src/js/storage.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/js/storage.js b/src/js/storage.js index f876f107..5f663ab5 100644 --- a/src/js/storage.js +++ b/src/js/storage.js @@ -53,7 +53,12 @@ class Storage { } // Get current storage - const storage = this.get(); + let storage = this.get(); + + // Default to empty object + if (utils.is.empty(storage)) { + storage = {}; + } // Update the working copy of the values utils.extend(storage, object); -- cgit v1.2.3