Skip to content

Commit

Permalink
fix crash in LeakedCollectionCheck
Browse files Browse the repository at this point in the history
  • Loading branch information
Luro02 committed Dec 17, 2024
1 parent cd41fbc commit 89a5d21
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ private void checkCtExecutableReturn(CtExecutable<?> ctExecutable) {

// a lambda like () -> true does not have a body, but an expression which is a return statement
// this case is handled here
if (statements.isEmpty() && ctExecutable instanceof CtLambda<?> ctLambda) {
if (statements.isEmpty() && ctExecutable instanceof CtLambda<?> ctLambda && ctLambda.getExpression() != null) {
statements = List.of(createCtReturn(ctLambda.getExpression().clone()));
}

Expand Down

0 comments on commit 89a5d21

Please sign in to comment.