To reproduce:
1. Double click on the first item. It will collapse.
2. Double click on the first item again. Instead of expansion it will throw NPE
java.lang.NullPointerException
at treeviewediting.TreeViewSample$TextFieldTreeCellImpl.cancelEdit(TreeViewSample.java:106)
at javafx.scene.control.Cell.updateItem(Cell.java:561)
at treeviewediting.TreeViewSample$TextFieldTreeCellImpl.updateItem(TreeViewSample.java:111)
at treeviewediting.TreeViewSample$TextFieldTreeCellImpl.updateItem(TreeViewSample.java:83)
at javafx.scene.control.TreeCell.updateItem(TreeCell.java:474)
at javafx.scene.control.TreeCell.indexChanged(TreeCell.java:436)
at javafx.scene.control.IndexedCell.updateIndex(IndexedCell.java:114)
at com.sun.javafx.scene.control.skin.VirtualFlow.releaseCell(VirtualFlow.java:1586)
at com.sun.javafx.scene.control.skin.VirtualFlow.getCellLength(VirtualFlow.java:1603)
at com.sun.javafx.scene.control.skin.VirtualFlow.computeViewportOffset(VirtualFlow.java:2126)
at com.sun.javafx.scene.control.skin.VirtualFlow.layoutChildren(VirtualFlow.java:1041)
1. Double click on the first item. It will collapse.
2. Double click on the first item again. Instead of expansion it will throw NPE
java.lang.NullPointerException
at treeviewediting.TreeViewSample$TextFieldTreeCellImpl.cancelEdit(TreeViewSample.java:106)
at javafx.scene.control.Cell.updateItem(Cell.java:561)
at treeviewediting.TreeViewSample$TextFieldTreeCellImpl.updateItem(TreeViewSample.java:111)
at treeviewediting.TreeViewSample$TextFieldTreeCellImpl.updateItem(TreeViewSample.java:83)
at javafx.scene.control.TreeCell.updateItem(TreeCell.java:474)
at javafx.scene.control.TreeCell.indexChanged(TreeCell.java:436)
at javafx.scene.control.IndexedCell.updateIndex(IndexedCell.java:114)
at com.sun.javafx.scene.control.skin.VirtualFlow.releaseCell(VirtualFlow.java:1586)
at com.sun.javafx.scene.control.skin.VirtualFlow.getCellLength(VirtualFlow.java:1603)
at com.sun.javafx.scene.control.skin.VirtualFlow.computeViewportOffset(VirtualFlow.java:2126)
at com.sun.javafx.scene.control.skin.VirtualFlow.layoutChildren(VirtualFlow.java:1041)