aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2017-01-25 05:21:55 +0800
committerkumavis <aaron@kumavis.me>2017-01-25 05:21:55 +0800
commit8049c1fc07c248d978ced12746e26e1b3f2eb003 (patch)
tree0b8176b72617a1af19a3fe11147c32f934b2aeea /app
parentde88a49243a54c6dfc3567bf30932f5a01d0c08d (diff)
downloadtangerine-wallet-browser-8049c1fc07c248d978ced12746e26e1b3f2eb003.tar
tangerine-wallet-browser-8049c1fc07c248d978ced12746e26e1b3f2eb003.tar.gz
tangerine-wallet-browser-8049c1fc07c248d978ced12746e26e1b3f2eb003.tar.bz2
tangerine-wallet-browser-8049c1fc07c248d978ced12746e26e1b3f2eb003.tar.lz
tangerine-wallet-browser-8049c1fc07c248d978ced12746e26e1b3f2eb003.tar.xz
tangerine-wallet-browser-8049c1fc07c248d978ced12746e26e1b3f2eb003.tar.zst
tangerine-wallet-browser-8049c1fc07c248d978ced12746e26e1b3f2eb003.zip
keyring-controller - cleanup
Diffstat (limited to 'app')
-rw-r--r--app/scripts/keyring-controller.js8
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)