Fix the cannot read property range of null bug

This commit is contained in:
Leonid Logvinov 2019-01-30 13:31:01 +01:00
parent 25e42c0ad4
commit e23f90e41c
No known key found for this signature in database
GPG Key ID: 0DD294BFDE8C95D4
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);