diff options
author | kumavis <aaron@kumavis.me> | 2017-01-25 05:21:55 +0800 |
---|---|---|
committer | kumavis <aaron@kumavis.me> | 2017-01-25 05:21:55 +0800 |
commit | 8049c1fc07c248d978ced12746e26e1b3f2eb003 (patch) | |
tree | 0b8176b72617a1af19a3fe11147c32f934b2aeea | |
parent | de88a49243a54c6dfc3567bf30932f5a01d0c08d (diff) | |
download | tangerine-wallet-browser-8049c1fc07c248d978ced12746e26e1b3f2eb003.tar.gz tangerine-wallet-browser-8049c1fc07c248d978ced12746e26e1b3f2eb003.tar.zst tangerine-wallet-browser-8049c1fc07c248d978ced12746e26e1b3f2eb003.zip |
keyring-controller - cleanup
-rw-r--r-- | app/scripts/keyring-controller.js | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js index 7a46c7737..858ea19ee 100644 --- a/app/scripts/keyring-controller.js +++ b/app/scripts/keyring-controller.js @@ -423,11 +423,9 @@ module.exports = class KeyringController extends EventEmitter { createFirstKeyTree () { this.clearKeyrings() return this.addNewKeyring('HD Key Tree', {numberOfAccounts: 1}) - .then(() => { - return this.keyrings[0].getAccounts() - }) - .then((accounts) => { - const firstAccount = accounts[0] + .then((keyring) => { + const firstAccount = keyring.getAccounts()[0] + if (!firstAccount) throw new Error('KeyringController - No account found on keychain.') const hexAccount = normalize(firstAccount) this.configManager.setSelectedAccount(hexAccount) this.emit('newAccount', hexAccount) |