From: Artur Signell Date: Tue, 13 Mar 2012 10:13:52 +0000 (+0200) Subject: #8500 Print an error message instead of throwing NPE if parent cannot be X-Git-Tag: 7.0.0.alpha2~340 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ea07d99b87ebf3640f219473e0edeaf650dbd303;p=vaadin-framework.git #8500 Print an error message instead of throwing NPE if parent cannot be found for some reason --- diff --git a/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java b/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java index 582fc3078c..b7aea9b735 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java @@ -184,7 +184,14 @@ public abstract class AbstractComponentConnector extends AbstractConnector // Set captions if (delegateCaptionHandling()) { - getParent().updateCaption(this, uidl); + ComponentContainerConnector parent = getParent(); + if (parent != null) { + parent.updateCaption(this, uidl); + } else { + VConsole.error("Parent of connector " + + getClass().getName() + + " is null. This is typically an indication of a broken component hierarchy"); + } } /*