src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java

Print this page
rev 6109 : Fix for bug #222081 reported to NetBeans - the page action should be ready for null return value from getPathBounds

@@ -4464,11 +4464,11 @@
                         newPath = tree.getClosestPathForLocation(visRect.x,
                                                                  visRect.y);
                     }
                 }
                 Rectangle            newRect = ui.getPathBounds(tree, newPath);
-
+                if (newRect != null) {
                 newRect.x = visRect.x;
                 newRect.width = visRect.width;
                 if(direction == -1) {
                     newRect.height = visRect.height;
                 }

@@ -4487,10 +4487,11 @@
                     ui.setLeadSelectionPath(newPath, true);
                 }
                 tree.scrollRectToVisible(newRect);
             }
         }
+        }
 
         private void home(JTree tree, BasicTreeUI ui, int direction,
                           boolean addToSelection, boolean changeSelection) {
 
             // disable moving of lead unless in discontiguous mode