diff options
author | Artur Signell <artur@vaadin.com> | 2012-03-15 13:42:10 +0200 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2012-03-15 13:42:10 +0200 |
commit | 2938d3185dc8886d15e1ebfa52ec708bc3c3fb08 (patch) | |
tree | 9509e805e9b3308b20096b173c5a32ee0a503eee /src/com | |
parent | 92e7ba655ab8ee048994b86640edea4388cad28e (diff) | |
download | vaadin-framework-2938d3185dc8886d15e1ebfa52ec708bc3c3fb08.tar.gz vaadin-framework-2938d3185dc8886d15e1ebfa52ec708bc3c3fb08.zip |
Avoid ClassCastException if widget has been previously attached to
another layout that used setLayoutData
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VMeasuringOrderedLayout.java | 7 |
1 files changed, 6 insertions, 1 deletions
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) { |