mbien commented on code in PR #8575:
URL: https://github.com/apache/netbeans/pull/8575#discussion_r2141889093


##########
java/java.hints/src/org/netbeans/modules/java/hints/control/RemoveUnnecessary.java:
##########
@@ -113,7 +113,9 @@ private static ErrorDescription 
unnecessaryReturnContinue(HintContext ctx, Tree
             List<? extends StatementTree> statements;
 
             tp = tp.getParentPath();
-
+            if (tp == null || tp.getLeaf() == null) { // prevent NPE

Review Comment:
   ```
    || tp.getLeaf() == null)
   ```
    can be removed since leaf is not nullable, I would remove the comment too 
since this can be implied.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to