From 0e37be0747b01563ed4b60c7d593a36fea654915 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Thu, 27 Oct 2016 01:01:07 +0100 Subject: [PATCH] Do not break if invalid account is selected in VM mode --- src/universal-dapp.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/universal-dapp.js b/src/universal-dapp.js index cc52c9c038..3cee816205 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -741,6 +741,9 @@ UniversalDApp.prototype.runTx = function (args, cb) { try { var address = self.getAddress ? self.getAddress() : Object.keys(self.accounts)[0] var account = self.accounts[address] + if (!account) { + return cb('Invalid account selected') + } tx = new EthJSTX({ nonce: new BN(account.nonce++), gasPrice: new BN(1),