summaryrefslogtreecommitdiffstats
path: root/client/src/com
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2012-10-30 12:50:08 +0200
committerLeif Åstrand <leif@vaadin.com>2012-10-30 12:50:08 +0200
commit88812ab9eed6b8e9babc3d9aac1cf13b5ee8750b (patch)
tree374f23eb70dbe7087d2d1d45bdb501bddb25834b /client/src/com
parent2364f3ec9fca600a5e926040ad3653de84bfed7d (diff)
downloadvaadin-framework-88812ab9eed6b8e9babc3d9aac1cf13b5ee8750b.tar.gz
vaadin-framework-88812ab9eed6b8e9babc3d9aac1cf13b5ee8750b.zip
Avoid NPE if CustomComponent has no child (#9895)
Change-Id: I020951fb4490b09f5026b9d75de95d1661399e93
Diffstat (limited to 'client/src/com')
-rw-r--r--client/src/com/vaadin/client/ui/customcomponent/CustomComponentConnector.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/client/src/com/vaadin/client/ui/customcomponent/CustomComponentConnector.java b/client/src/com/vaadin/client/ui/customcomponent/CustomComponentConnector.java
index d14337afe4..09c90b3577 100644
--- a/client/src/com/vaadin/client/ui/customcomponent/CustomComponentConnector.java
+++ b/client/src/com/vaadin/client/ui/customcomponent/CustomComponentConnector.java
@@ -38,13 +38,13 @@ public class CustomComponentConnector extends
@Override
public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event) {
- ComponentConnector newChild = null;
+ VCustomComponent customComponent = getWidget();
if (getChildComponents().size() == 1) {
- newChild = getChildComponents().get(0);
+ ComponentConnector newChild = getChildComponents().get(0);
+ customComponent.setWidget(newChild.getWidget());
+ } else {
+ customComponent.setWidget(null);
}
- VCustomComponent customComponent = getWidget();
- customComponent.setWidget(newChild.getWidget());
-
}
}