From 5077489455c50cb75e641cb9a527185de7d3d1a1 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 16 Mar 2012 12:08:14 +0200 Subject: [PATCH] Panel can have 0 children if its contents is hidden on server side --- .../vaadin/terminal/gwt/client/ui/PanelConnector.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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); } -- 2.39.5