From ca2fff8fc602ad9e3f328315d488a468394e35cc Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 9 Jan 2017 10:33:59 +0100 Subject: [PATCH] bug fix --- src/trace/traceCache.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/trace/traceCache.js b/src/trace/traceCache.js index 000b9bee7c..10482ea1e1 100644 --- a/src/trace/traceCache.js +++ b/src/trace/traceCache.js @@ -35,11 +35,13 @@ TraceCache.prototype.pushMemoryChanges = function (value) { TraceCache.prototype.pushCall = function (step, index, address, callStack, reverted, outOfGas) { if (step.op === 'RETURN' || step.op === 'STOP' || reverted) { - this.currentCall.call.return = index - 1 - this.currentCall.call.reverted = reverted - this.currentCall.call.outOfGas = outOfGas - var parent = this.currentCall.parent - this.currentCall = parent ? { call: parent.call, parent: parent.parent } : null + if (this.currentCall) { + this.currentCall.call.return = index - 1 + this.currentCall.call.reverted = reverted + this.currentCall.call.outOfGas = outOfGas + var parent = this.currentCall.parent + this.currentCall = parent ? { call: parent.call, parent: parent.parent } : null + } } else { var call = { op: step.op,