From 2fea1319d9c80a758f86133eeec358b12a565676 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sat, 5 Aug 2017 14:41:28 -0700 Subject: [PATCH] cli: fix errors. --- bin/cli | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/cli b/bin/cli index d6e55154..247e72bf 100755 --- a/bin/cli +++ b/bin/cli @@ -81,6 +81,10 @@ CLI.prototype.getWIF = async function getWIF() { const address = this.config.str(0); const passphrase = this.config.str('passphrase'); const key = await this.wallet.getWIF(address, passphrase); + if (!key) { + this.log('Key not found.'); + return; + } this.log(key.privateKey); }; @@ -101,6 +105,10 @@ CLI.prototype.removeSharedKey = async function removeSharedKey() { CLI.prototype.getSharedKeys = async function getSharedKeys() { const acct = this.config.str([0, 'account']); const account = await this.wallet.getAccount(acct); + if (!account) { + this.log('Account not found.'); + return; + } this.log(account.keys); };