From: Artur Signell Date: Fri, 16 Mar 2012 10:08:14 +0000 (+0200) Subject: Panel can have 0 children if its contents is hidden on server side X-Git-Tag: 7.0.0.alpha2~303 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5077489455c50cb75e641cb9a527185de7d3d1a1;p=vaadin-framework.git Panel can have 0 children if its contents is hidden on server side --- diff --git a/src/com/vaadin/terminal/gwt/client/ui/PanelConnector.java b/src/com/vaadin/terminal/gwt/client/ui/PanelConnector.java index ef18f9f210..f5766d8ab4 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/PanelConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/PanelConnector.java @@ -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); }