]> source.dussan.org Git - vaadin-framework.git/commitdiff
getParent() shouldn't throw npe when widget's parent is null (#8323)
authorLeif Åstrand <leif@vaadin.com>
Wed, 8 Feb 2012 07:06:15 +0000 (09:06 +0200)
committerLeif Åstrand <leif@vaadin.com>
Wed, 8 Feb 2012 07:06:15 +0000 (09:06 +0200)
src/com/vaadin/terminal/gwt/client/ui/VAbstractPaintableWidget.java

index efe6896e9b2f44da7e8867482df5b1f1141e4a59..355516ccd1dd1f45c58adf22060d4d3a14475427 100644 (file)
@@ -94,15 +94,15 @@ public abstract class VAbstractPaintableWidget implements VPaintableWidget {
         VPaintableMap paintableMap = VPaintableMap.get(getConnection());
 
         Widget w = getWidgetForPaintable();
-        while (w != null) {
+        while (true) {
             w = w.getParent();
+            if (w == null) {
+                return null;
+            }
             if (paintableMap.isPaintable(w)) {
-                return (VPaintableWidgetContainer) paintableMap
-                        .getPaintable(w);
+                return (VPaintableWidgetContainer) paintableMap.getPaintable(w);
             }
         }
-
-        return null;
     }
 
     protected static boolean isRealUpdate(UIDL uidl) {