Skip to content

Commit

Permalink
Add a missing null check in WrongOneof.
Browse files Browse the repository at this point in the history
Same fix as 150334e, though it seems hilariously unlikely anyone would do it here.

PiperOrigin-RevId: 698402619
  • Loading branch information
graememorgan authored and Error Prone Team committed Nov 20, 2024
1 parent a52662d commit 4d239e8
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ private void processSwitch(
break;
}
for (var caseExpression : caseTree.getExpressions()) {
allowableGetters.add(getter(getSymbol(caseExpression).getSimpleName().toString()));
var symbol = getSymbol(caseExpression);
if (symbol != null) {
allowableGetters.add(getter(symbol.getSimpleName().toString()));
}
}

scanForInvalidGetters(getters, allowableGetters, caseTree, constantReceiver, state);
Expand Down

0 comments on commit 4d239e8

Please sign in to comment.