From 2938d3185dc8886d15e1ebfa52ec708bc3c3fb08 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 15 Mar 2012 13:42:10 +0200 Subject: [PATCH] Avoid ClassCastException if widget has been previously attached to another layout that used setLayoutData --- .../terminal/gwt/client/ui/VMeasuringOrderedLayout.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) { -- 2.39.5