]> source.dussan.org Git - vaadin-framework.git/commitdiff
Avoid ClassCastException if widget has been previously attached to
authorArtur Signell <artur@vaadin.com>
Thu, 15 Mar 2012 11:42:10 +0000 (13:42 +0200)
committerArtur Signell <artur@vaadin.com>
Thu, 15 Mar 2012 11:42:10 +0000 (13:42 +0200)
another layout that used setLayoutData

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

index 3c0e9af26d754302ed9065cdd0337920950c42c7..ce317ee563362cc7da5394ba52002325bcc54192 100644 (file)
@@ -85,7 +85,12 @@ public class VMeasuringOrderedLayout extends ComplexPanel {
     }
 
     public VLayoutSlot getSlotForChild(Widget widget) {
-        return (VLayoutSlot) widget.getLayoutData();
+        Object o = widget.getLayoutData();
+        if (o instanceof VLayoutSlot) {
+            return (VLayoutSlot) o;
+        }
+
+        return null;
     }
 
     public void setCaption(Widget child, VCaption caption) {