From c30a289945a727230da6754657d59ef93ca56d42 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Sun, 30 Oct 2016 19:14:38 -0400 Subject: [PATCH] handle error if no accounts are found --- lib/deploy.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/deploy.js b/lib/deploy.js index 8e43994ea..2f34bea77 100644 --- a/lib/deploy.js +++ b/lib/deploy.js @@ -109,7 +109,9 @@ Deploy.prototype.deployContract = function(contract, params, callback) { var contractParams = (params || contract.args).slice(); this.web3.eth.getAccounts(function(err, accounts) { - //console.log("using address" + this.web3.eth.accounts[0]); + if (err) { + return callback(new Error(err)); + } // TODO: probably needs to be defaultAccount // TODO: it wouldn't necessary be the first address