diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-01-30 20:31:01 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-01-30 21:04:19 +0800 |
commit | e23f90e41c177552aa7e1bde98c6ba1b7acb9d4f (patch) | |
tree | afd1a7ad10590690af1543ad57e51a62a268dc71 /packages/sol-tracing-utils | |
parent | 25e42c0ad47e9ec06e474cd12a488ae837660302 (diff) | |
download | dexon-0x-contracts-e23f90e41c177552aa7e1bde98c6ba1b7acb9d4f.tar.gz dexon-0x-contracts-e23f90e41c177552aa7e1bde98c6ba1b7acb9d4f.tar.zst dexon-0x-contracts-e23f90e41c177552aa7e1bde98c6ba1b7acb9d4f.zip |
Fix the cannot read property range of null bug
Diffstat (limited to 'packages/sol-tracing-utils')
-rw-r--r-- | packages/sol-tracing-utils/CHANGELOG.json | 4 | ||||
-rw-r--r-- | packages/sol-tracing-utils/src/ast_visitor.ts | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/packages/sol-tracing-utils/CHANGELOG.json b/packages/sol-tracing-utils/CHANGELOG.json index 16a12ca63..024e896da 100644 --- a/packages/sol-tracing-utils/CHANGELOG.json +++ b/packages/sol-tracing-utils/CHANGELOG.json @@ -17,6 +17,10 @@ { "note": "Print resasonable error message on bytecode collision", "pr": 1535 + }, + { + "note": "Fix the bug in `ASTVisitor` causing the 'cannot read property `range` of `null`' error", + "pr": 1557 } ] }, diff --git a/packages/sol-tracing-utils/src/ast_visitor.ts b/packages/sol-tracing-utils/src/ast_visitor.ts index 1ac9cd1de..27f19378b 100644 --- a/packages/sol-tracing-utils/src/ast_visitor.ts +++ b/packages/sol-tracing-utils/src/ast_visitor.ts @@ -89,7 +89,9 @@ export class ASTVisitor { this._visitStatement(ast); } public ExpressionStatement(ast: Parser.ExpressionStatement): void { - this._visitStatement(ast.expression); + if (!_.isNull(ast.expression)) { + this._visitStatement(ast.expression); + } } public InlineAssemblyStatement(ast: Parser.InlineAssemblyStatement): void { this._visitStatement(ast); |