]> source.dussan.org Git - vaadin-framework.git/commitdiff
#8500 Print an error message instead of throwing NPE if parent cannot be
authorArtur Signell <artur@vaadin.com>
Tue, 13 Mar 2012 10:13:52 +0000 (12:13 +0200)
committerArtur Signell <artur@vaadin.com>
Wed, 14 Mar 2012 14:00:43 +0000 (16:00 +0200)
found for some reason

src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java

index 582fc3078cb9a2fd1689fe97f415a6d1382bbe32..b7aea9b7350341ef67e548407150867f81cdb3e9 100644 (file)
@@ -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");
+            }
         }
 
         /*