Merge pull request #1557 from 0xProject/fix/sol-cov/property-range-of-null

Fix the `cannot read property range of null` bug
This commit is contained in:
Leonid Logvinov
2019-01-30 14:11:53 +01:00
committed by GitHub
2 changed files with 7 additions and 1 deletions

View File

@@ -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
}
]
},

View File

@@ -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);