]> source.dussan.org Git - vaadin-framework.git/commitdiff
Panel can have 0 children if its contents is hidden on server side
authorArtur Signell <artur@vaadin.com>
Fri, 16 Mar 2012 10:08:14 +0000 (12:08 +0200)
committerArtur Signell <artur@vaadin.com>
Fri, 16 Mar 2012 10:08:14 +0000 (12:08 +0200)
src/com/vaadin/terminal/gwt/client/ui/PanelConnector.java

index ef18f9f2108b8c94b06355d5a324c4113723ebe4..f5766d8ab41e93bd3282fa997be016d300b552a5 100644 (file)
@@ -262,10 +262,12 @@ public class PanelConnector extends AbstractComponentContainerConnector
     @Override
     public void connectorHierarchyChanged(ConnectorHierarchyChangedEvent event) {
         super.connectorHierarchyChanged(event);
-        // We always have 1 child, Panel takes care of ensuring content is never
-        // null
-        ComponentConnector newChild = getChildren().get(0);
-        Widget newChildWidget = newChild.getWidget();
+        // We always have 1 child, unless the child is hidden
+        Widget newChildWidget = null;
+        if (getChildren().size() == 1) {
+            ComponentConnector newChild = getChildren().get(0);
+            newChildWidget = newChild.getWidget();
+        }
 
         getWidget().setWidget(newChildWidget);
     }