changeset 98:b13ea35c580f

RT-18306: NPE in TreeView FocusModel
author Jonathan Giles
date Thu, 01 Dec 2011 10:12:42 +1000
parents 349ecca8c8da
children 581183c6c16a
files javafx-ui-controls/src/javafx/scene/control/TreeView.java
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/javafx/scene/control/TreeView.java	Thu Dec 01 09:42:48 2011 +1000
+++ b/javafx-ui-controls/src/javafx/scene/control/TreeView.java	Thu Dec 01 10:12:42 2011 +1000
@@ -1252,7 +1252,7 @@
                         TreeItem item = e.getAddedChildren().get(i);
                         row = treeView.getRow(item);
                         
-                        if (row <= getFocusedIndex()) {
+                        if (item != null && row <= getFocusedIndex()) {
 //                            shift = e.getTreeItem().isExpanded() ? e.getAddedSize() : 0;
                             shift += item.getExpandedDescendentCount();
                         }