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) { if (!compResult) {
this.event.trigger('noCallTreeAvailable', []) this.event.trigger('noCallTreeAvailable', [])
} else { } else {
buildTree(this, 0, scopeId, isCreation).then((result) => { try {
if (result.error) { buildTree(this, 0, scopeId, isCreation).then((result) => {
this.event.trigger('callTreeBuildFailed', [result.error]) if (result.error) {
} else { this.event.trigger('callTreeBuildFailed', [result.error])
createReducedTrace(this, traceManager.trace.length - 1) } else {
console.log('call tree build lasts ', (Date.now() - time) / 1000) createReducedTrace(this, traceManager.trace.length - 1)
this.event.trigger('callTreeReady', [this.scopes, this.scopeStarts]) 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) }, (reason) => {
this.event.trigger('callTreeNotReady', [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) { for (const source of generatedSources) {
if (source.id === sourceLocation.file) return source.ast 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 compilationResult.data.sources[file].ast
} }
return null return null

Loading…
Cancel
Save