diff options
metamask - never persist if state is missing data
-rw-r--r-- | app/scripts/background.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/app/scripts/background.js b/app/scripts/background.js index a4d95289b..837fd7133 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -162,9 +162,9 @@ function setupController (initState, initLangCode) { asStream(controller.store), debounce(1000), storeTransform(versionifyData), - storeTransform(syncDataWithExtension), + storeTransform(persistData), (error) => { - log.error('pump hit error', error) + log.error('MetaMask - Persistence pipeline failed', error) } ) @@ -173,7 +173,10 @@ function setupController (initState, initLangCode) { return versionedData } - function syncDataWithExtension(state) { + function persistData(state) { + if (!state.data) { + throw new Error('MetaMask - updated state is missing data', state) + } if (localStore.isSupported) { localStore.set(state) .catch((err) => { |