diff --git a/src/universal-dapp.js b/src/universal-dapp.js index 299f832a94..0c95698aab 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -549,14 +549,15 @@ UniversalDApp.prototype.getCallButton = function (args) { var decoded self.runTx({ to: args.address, data: data, useCall: args.abi.constant && !isConstructor }, function (err, txResult) { - var result + if (!txResult) { + replaceOutput($result, $('').text('callback contain no result ' + err).addClass('error')) + return + } + var result = txResult.result if (err) { replaceOutput($result, $('').text(err).addClass('error')) // VM only - } else { - result = txResult.result - } - if (self.executionContext.isVM() && result.vm.exception === 0 && result.vm.exceptionError) { + } else if (self.executionContext.isVM() && result.vm.exception === 0 && result.vm.exceptionError) { replaceOutput($result, $('').text('VM Exception: ' + result.vm.exceptionError).addClass('error')) $result.append(getDebugTransaction(txResult)) // VM only