diff options
author | Ofek <ofekshilon@gmail.com> | 2024-04-13 12:35:00 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-13 12:35:00 +0300 |
commit | b9512ed7dd3e3162fe93b2bd518f52092d27c4e6 (patch) | |
tree | 4c442e051fef50fdaa61300a0bcbffc68fff2e74 /lib/compilers | |
parent | a47d3c68fc98b5c3a17298aa121e13665bb7245a (diff) | |
download | compiler-explorer-b9512ed7dd3e3162fe93b2bd518f52092d27c4e6.tar.gz compiler-explorer-b9512ed7dd3e3162fe93b2bd518f52092d27c4e6.zip |
Fix Sentry Issue (#6349)gh-11282
<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE
IT
Thanks for taking the time to improve CE. We really appreciate it.
Before opening the PR, please make sure that the tests & linter pass
their checks,
by running `make check`.
In the best case scenario, you are also adding tests to back up your
changes,
but don't sweat it if you don't. We can discuss them at a later date.
Feel free to append your name to the CONTRIBUTORS.md file
Thanks again, we really appreciate this!
-->
Diffstat (limited to 'lib/compilers')
-rw-r--r-- | lib/compilers/solidity.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/compilers/solidity.ts b/lib/compilers/solidity.ts index 13812b052..b254710d3 100644 --- a/lib/compilers/solidity.ts +++ b/lib/compilers/solidity.ts @@ -102,11 +102,12 @@ export class SolidityCompiler extends BaseCompiler { let contractFunctions; // the layout of this JSON has changed between versions... if (hasOldJSONLayout) { - contractFunctions = asm.sources[sourceName].AST.children - .find(node => { + contractFunctions = ( + asm.sources[sourceName].AST.children.find(node => { return node.name === 'ContractDefinition' && node.attributes.name === contractName; - }) - .children.filter(node => { + }).children ?? [] + ) + .filter(node => { return node.name === 'FunctionDefinition'; }) .map(node => { |