do not throw if ast not present

pull/3195/head
yann300 2 years ago committed by Aniket
parent ff0a6b2b19
commit 6471fcb2aa
  1. 28
      libs/remix-debug/src/solidity-decoder/internalCallTree.ts
  2. 2
      libs/remix-debug/src/solidity-decoder/solidityProxy.ts

@ -82,18 +82,22 @@ export class InternalCallTree {
if (!compResult) {
this.event.trigger('noCallTreeAvailable', [])
} else {
buildTree(this, 0, scopeId, isCreation).then((result) => {
if (result.error) {
this.event.trigger('callTreeBuildFailed', [result.error])
} else {
createReducedTrace(this, traceManager.trace.length - 1)
console.log('call tree build lasts ', (Date.now() - time) / 1000)
this.event.trigger('callTreeReady', [this.scopes, this.scopeStarts])
}
}, (reason) => {
console.log('analyzing trace falls ' + reason)
this.event.trigger('callTreeNotReady', [reason])
})
try {
buildTree(this, 0, scopeId, isCreation).then((result) => {
if (result.error) {
this.event.trigger('callTreeBuildFailed', [result.error])
} else {
createReducedTrace(this, traceManager.trace.length - 1)
console.log('call tree build lasts ', (Date.now() - time) / 1000)
this.event.trigger('callTreeReady', [this.scopes, this.scopeStarts])
}
}, (reason) => {
console.log('analyzing trace falls ' + reason)
this.event.trigger('callTreeNotReady', [reason])
})
} catch (e) {
console.log(e)
}
}
})
}

@ -115,7 +115,7 @@ export class SolidityProxy {
for (const source of generatedSources) {
if (source.id === sourceLocation.file) return source.ast
}
} else if (compilationResult.data.sources[file]) {
} else if (compilationResult.data.sources && compilationResult.data.sources[file]) {
return compilationResult.data.sources[file].ast
}
return null

Loading…
Cancel
Save