changeset 2219:98a7bfe0f231

RT-27607: [TreeTableView] Double click throws exception
author jgiles
date Fri, 11 Jan 2013 09:21:46 +1300
parents d84bb839e63e
children cd08af7a4726
files javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/TreeTableRowBehavior.java
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/TreeTableRowBehavior.java	Fri Jan 11 09:10:20 2013 +1300
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/TreeTableRowBehavior.java	Fri Jan 11 09:21:46 2013 +1300
@@ -47,6 +47,8 @@
         TreeTableRow<T> treeTableRow = getControl();
         TreeTableView<T> tv = treeTableRow.getTreeTableView();
         TreeItem treeItem = treeTableRow.getTreeItem();
+        if (treeItem == null) return;
+        
         int index = treeTableRow.getIndex();
         MultipleSelectionModel sm = tv.getSelectionModel();
         boolean isAlreadySelected = sm.isSelected(index);
@@ -56,9 +58,7 @@
         Node disclosureNode = treeTableRow.getDisclosureNode();
         if (disclosureNode != null) {
             if (disclosureNode.getBoundsInParent().contains(e.getX(), e.getY())) {
-                if (treeItem != null) {
-                    treeItem.setExpanded(! treeItem.isExpanded());
-                }
+                treeItem.setExpanded(! treeItem.isExpanded());
                 return;
             }
         }