Skip to content

Commit

Permalink
Merge pull request #1614 from jplag/feature/go-null-pointer
Browse files Browse the repository at this point in the history
Avoided null pointer exception in JPlagGoListener.
  • Loading branch information
tsaglam authored Feb 28, 2024
2 parents 7273710 + 51dae1c commit b23646f
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,16 @@ public void visitTerminal(TerminalNode node) {
expectAndLeave(GoBlockContext.IF_BLOCK);
enterContext(GoBlockContext.ELSE_BLOCK);
}
case "{" -> transformToken(getCurrentContext().getBegin(), token);
case "}" -> transformToken(getCurrentContext().getEnd(), token);
case "{" -> {
if (getCurrentContext() != null) {
transformToken(getCurrentContext().getBegin(), token);
}
}
case "}" -> {
if (getCurrentContext() != null) {
transformToken(getCurrentContext().getEnd(), token);
}
}
default -> {
// do nothing.
}
Expand Down

0 comments on commit b23646f

Please sign in to comment.