From: Artur Signell Date: Thu, 15 Mar 2012 11:42:10 +0000 (+0200) Subject: Avoid ClassCastException if widget has been previously attached to X-Git-Tag: 7.0.0.alpha2~314 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2938d3185dc8886d15e1ebfa52ec708bc3c3fb08;p=vaadin-framework.git Avoid ClassCastException if widget has been previously attached to another layout that used setLayoutData --- diff --git a/src/com/vaadin/terminal/gwt/client/ui/VMeasuringOrderedLayout.java b/src/com/vaadin/terminal/gwt/client/ui/VMeasuringOrderedLayout.java index 3c0e9af26d..ce317ee563 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VMeasuringOrderedLayout.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VMeasuringOrderedLayout.java @@ -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) {