do not throw if ast not present

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

@ -82,6 +82,7 @@ export class InternalCallTree {
if (!compResult) { if (!compResult) {
this.event.trigger('noCallTreeAvailable', []) this.event.trigger('noCallTreeAvailable', [])
} else { } else {
try {
buildTree(this, 0, scopeId, isCreation).then((result) => { buildTree(this, 0, scopeId, isCreation).then((result) => {
if (result.error) { if (result.error) {
this.event.trigger('callTreeBuildFailed', [result.error]) this.event.trigger('callTreeBuildFailed', [result.error])
@ -94,6 +95,9 @@ export class InternalCallTree {
console.log('analyzing trace falls ' + reason) console.log('analyzing trace falls ' + reason)
this.event.trigger('callTreeNotReady', [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