From 0ea0a9813d1e33613d19a6a74f8966a6e8f4a2ac Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 12 Sep 2016 15:26:07 -0700 Subject: [PATCH] Make cache clearning error tolerant --- app/scripts/lib/idStore.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js index e84e1aba0..b5b13a57a 100644 --- a/app/scripts/lib/idStore.js +++ b/app/scripts/lib/idStore.js @@ -503,7 +503,12 @@ IdentityStore.prototype._createIdMgmt = function (derivedKey) { IdentityStore.prototype.purgeCache = function () { this._currentState.identities = {} - var accounts = Object.keys(this._ethStore._currentState.accounts) + let accounts + try { + Object.keys(this._ethStore._currentState.accounts) + } catch (e) { + accounts = [] + } accounts.forEach((address) => { this._ethStore.removeAccount(address) })