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


##########
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.getLeaf() == null) { // prevent NPE
+                continue;
+            }

Review Comment:
   my solution to that was to `return null;` if the path is null which would 
exit the logic and not show a hint.
   
   Continuing might be fine but without reproducer I am not sure if the state 
is still ok if the leafs start to be null.



-- 
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: notifications-unsubscr...@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org
For additional commands, e-mail: notifications-h...@netbeans.apache.org

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

Reply via email to