Skip to content

Commit

Permalink
refactor(goast): improve null safety in GoFullIdentListener
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Nov 9, 2024
1 parent cbb9134 commit fef025f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ class GoFullIdentListener(var fileName: String) : GoAstListener() {
override fun enterConstDecl(ctx: GoParser.ConstDeclContext?) {
ctx?.constSpec()?.forEach { constSpecContext ->
constSpecContext.identifierList().IDENTIFIER().forEach { terminalNode ->
localVars[terminalNode.text] = constSpecContext.type_()?.text ?: constSpecContext.expressionList().text
localVars[terminalNode.text] = constSpecContext.type_()?.text ?: constSpecContext?.expressionList()?.text ?: ""
}
}
}
Expand Down

0 comments on commit fef025f

Please sign in to comment.