aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2018-04-07 03:10:39 +0800
committerkumavis <aaron@kumavis.me>2018-04-07 03:10:39 +0800
commitf9a6feb26369048d63cc3794f4f94db4c89ed287 (patch)
tree1dd2bce03d0ef390b2366a15d47b6e94766c529f
parent6f4dbd6d4a27888ccff88d336ae4340cb69c90e7 (diff)
downloadtangerine-wallet-browser-f9a6feb26369048d63cc3794f4f94db4c89ed287.tar
tangerine-wallet-browser-f9a6feb26369048d63cc3794f4f94db4c89ed287.tar.gz
tangerine-wallet-browser-f9a6feb26369048d63cc3794f4f94db4c89ed287.tar.bz2
tangerine-wallet-browser-f9a6feb26369048d63cc3794f4f94db4c89ed287.tar.lz
tangerine-wallet-browser-f9a6feb26369048d63cc3794f4f94db4c89ed287.tar.xz
tangerine-wallet-browser-f9a6feb26369048d63cc3794f4f94db4c89ed287.tar.zst
tangerine-wallet-browser-f9a6feb26369048d63cc3794f4f94db4c89ed287.zip
metamask - never persist if state is missing
-rw-r--r--app/scripts/background.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/scripts/background.js b/app/scripts/background.js
index 837fd7133..5878cd2e8 100644
--- a/app/scripts/background.js
+++ b/app/scripts/background.js
@@ -174,8 +174,11 @@ function setupController (initState, initLangCode) {
}
function persistData(state) {
+ if (!state) {
+ throw new Error('MetaMask - updated state is missing', state)
+ }
if (!state.data) {
- throw new Error('MetaMask - updated state is missing data', state)
+ throw new Error('MetaMask - updated state does not have data', state)
}
if (localStore.isSupported) {
localStore.set(state)