From: Matti Tahvonen Date: Thu, 13 Nov 2008 09:41:55 +0000 (+0000) Subject: added sanity check X-Git-Tag: 6.7.0.beta1~3812 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0f41b4a4cb4af1b93dae1687bdba83befdf20aff;p=vaadin-framework.git added sanity check svn changeset:5882/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/ui/OrderedLayout.java b/src/com/itmill/toolkit/ui/OrderedLayout.java index 285f1a5df1..40172a447d 100644 --- a/src/com/itmill/toolkit/ui/OrderedLayout.java +++ b/src/com/itmill/toolkit/ui/OrderedLayout.java @@ -386,11 +386,16 @@ public class OrderedLayout extends AbstractLayout implements * @see Sizeable * * @param component - * the component which expand ratio is to be set + * the component in this layout which expand ratio is to be set * @param ratio */ public void setExpandRatio(Component component, float ratio) { - componentToExpandRatio.put(component, ratio); + if (components.contains(component)) { + componentToExpandRatio.put(component, ratio); + } else { + throw new IllegalArgumentException( + "Component must be added to layout before using setExpandRatio()"); + } }; /**