diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-01-30 21:11:53 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-30 21:11:53 +0800 |
commit | c9a7ef18dc75675bb1880734ce786ba126359ae6 (patch) | |
tree | afd1a7ad10590690af1543ad57e51a62a268dc71 /packages/sol-tracing-utils | |
parent | 25e42c0ad47e9ec06e474cd12a488ae837660302 (diff) | |
parent | e23f90e41c177552aa7e1bde98c6ba1b7acb9d4f (diff) | |
download | dexon-0x-contracts-c9a7ef18dc75675bb1880734ce786ba126359ae6.tar dexon-0x-contracts-c9a7ef18dc75675bb1880734ce786ba126359ae6.tar.gz dexon-0x-contracts-c9a7ef18dc75675bb1880734ce786ba126359ae6.tar.bz2 dexon-0x-contracts-c9a7ef18dc75675bb1880734ce786ba126359ae6.tar.lz dexon-0x-contracts-c9a7ef18dc75675bb1880734ce786ba126359ae6.tar.xz dexon-0x-contracts-c9a7ef18dc75675bb1880734ce786ba126359ae6.tar.zst dexon-0x-contracts-c9a7ef18dc75675bb1880734ce786ba126359ae6.zip |
Merge pull request #1557 from 0xProject/fix/sol-cov/property-range-of-null
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); |