aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-01-24 21:13:20 +0800
committerDan <danjm.com@gmail.com>2018-01-24 21:13:20 +0800
commitb7ae77f57a0e2bc68e9548364baa120805a1420c (patch)
tree02c474fd341a62cf347897cd964740f3f9cc78a6 /app/scripts/lib
parent0164030e56b1db8117a1a0bdff91987321b2cd1a (diff)
downloadtangerine-wallet-browser-b7ae77f57a0e2bc68e9548364baa120805a1420c.tar
tangerine-wallet-browser-b7ae77f57a0e2bc68e9548364baa120805a1420c.tar.gz
tangerine-wallet-browser-b7ae77f57a0e2bc68e9548364baa120805a1420c.tar.bz2
tangerine-wallet-browser-b7ae77f57a0e2bc68e9548364baa120805a1420c.tar.lz
tangerine-wallet-browser-b7ae77f57a0e2bc68e9548364baa120805a1420c.tar.xz
tangerine-wallet-browser-b7ae77f57a0e2bc68e9548364baa120805a1420c.tar.zst
tangerine-wallet-browser-b7ae77f57a0e2bc68e9548364baa120805a1420c.zip
Check that extension.storage exists before attempting to call methods on it.
Diffstat (limited to 'app/scripts/lib')
-rw-r--r--app/scripts/lib/extension-store.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/scripts/lib/extension-store.js b/app/scripts/lib/extension-store.js
index 67ee71f16..4a970321c 100644
--- a/app/scripts/lib/extension-store.js
+++ b/app/scripts/lib/extension-store.js
@@ -15,12 +15,12 @@ const handleDisabledSyncAndResolve = (resolve, toResolve) => {
module.exports = class ExtensionStore {
constructor() {
- this.isSupported = !!(extension.storage.sync)
+ this.isSupported = !!(extension.storage && extension.storage.sync)
this.isEnabled = true // TODO: get value from user settings
}
async fetch() {
return new Promise((resolve) => {
- extension.storage.sync.get(KEYS_TO_SYNC, (data) => {
+ extension.storage && extension.storage.sync.get(KEYS_TO_SYNC, (data) => {
handleDisabledSyncAndResolve(resolve, data)
})
})
@@ -31,7 +31,7 @@ module.exports = class ExtensionStore {
return result
}, {})
return new Promise((resolve) => {
- extension.storage.sync.set(dataToSync, () => {
+ extension.storage && extension.storage.sync.set(dataToSync, () => {
handleDisabledSyncAndResolve(resolve)
})
})