// does not change component hierarchy during paint
containerSupportsPartialUpdates = (newDataSource instanceof ItemSetChangeNotifier) && false;
- if (!(newDataSource instanceof Hierarchical)) {
+ if (newDataSource != null && !(newDataSource instanceof Hierarchical)) {
newDataSource = new ContainerHierarchicalWrapper(newDataSource);
}
- if (!(newDataSource instanceof Ordered)) {
+ if (newDataSource != null && !(newDataSource instanceof Ordered)) {
newDataSource = new HierarchicalContainerOrderedWrapper(
(Hierarchical) newDataSource);
}
--- /dev/null
+package com.vaadin.tests.server.component.treetable;
+
+import junit.framework.TestCase;
+
+import com.vaadin.ui.TreeTable;
+
+public class TreeTableSetContainerNull extends TestCase {
+
+ public void testNullContainer() {
+ TreeTable treeTable = new TreeTable();
+
+ // should not cause an exception
+ treeTable.setContainerDataSource(null);
+ }
+}