diff options
author | Aleksi Hietanen <aleksi@vaadin.com> | 2017-04-12 15:03:17 +0300 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-04-12 15:03:17 +0300 |
commit | 2c3e399cb654588c8159e0e4ec4de7cc7de81b7b (patch) | |
tree | d42b862d3e978852a2b7143f3dc94af8730e8169 /client/src | |
parent | c1ecea9aa4729b1c8c3d00ebefa1a2a08a352ebf (diff) | |
download | vaadin-framework-2c3e399cb654588c8159e0e4ec4de7cc7de81b7b.tar.gz vaadin-framework-2c3e399cb654588c8159e0e4ec4de7cc7de81b7b.zip |
Fix empty TreeGrid (#9067)
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/main/java/com/vaadin/client/connectors/treegrid/TreeGridConnector.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/client/src/main/java/com/vaadin/client/connectors/treegrid/TreeGridConnector.java b/client/src/main/java/com/vaadin/client/connectors/treegrid/TreeGridConnector.java index 72c4487aaf..b5c11eba1d 100644 --- a/client/src/main/java/com/vaadin/client/connectors/treegrid/TreeGridConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/treegrid/TreeGridConnector.java @@ -98,7 +98,8 @@ public class TreeGridConnector extends GridConnector { // Id of new hierarchy column. Choose first when nothing explicitly // set String newHierarchyColumnId = getState().hierarchyColumnId; - if (newHierarchyColumnId == null) { + if (newHierarchyColumnId == null + && !getState().columnOrder.isEmpty()) { newHierarchyColumnId = getState().columnOrder.get(0); } @@ -106,6 +107,11 @@ public class TreeGridConnector extends GridConnector { Grid.Column<?, ?> newColumn = getColumn(newHierarchyColumnId); Grid.Column<?, ?> oldColumn = getColumn(oldHierarchyColumnId); + if (newColumn == null && oldColumn == null) { + // No hierarchy column defined + return; + } + // Unwrap renderer of old column if (oldColumn != null && oldColumn.getRenderer() instanceof HierarchyRenderer) { |