solidity-parser-antlr
solidity-parser-antlr copied to clipboard
Fixed transformAST.TypeName
In transformAST.TypeName
, it is possible for ctx.children
to be null
. An example scenario is when the last argument of a function definition has a trailing comma.
The existing implementation assumes ctx.children
has the property length
, which causes an exception when ctx.children
is null
. This commit fixes this issue by adding an if statement that checks for this condition. If ctx.children
is indeed null
, the fixed version returns this.visit(ctx.getChild(0))
, which is the default return value used in the existing implementation.