From: Matti Tahvonen Date: Thu, 24 May 2007 06:57:22 +0000 (+0000) Subject: added check to only remove component if it really is a containers child (avoid errors... X-Git-Tag: 6.7.0.beta1~6379 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=91ac8d001e45b314679c405e83c48104eaab31f5;p=vaadin-framework.git added check to only remove component if it really is a containers child (avoid errors if programmer makes mistake) svn changeset:1469/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/ui/AbstractComponentContainer.java b/src/com/itmill/toolkit/ui/AbstractComponentContainer.java index 60e77dd42f..1719d6aac9 100644 --- a/src/com/itmill/toolkit/ui/AbstractComponentContainer.java +++ b/src/com/itmill/toolkit/ui/AbstractComponentContainer.java @@ -200,7 +200,9 @@ public abstract class AbstractComponentContainer extends AbstractComponent * @see com.itmill.toolkit.ui.ComponentContainer#removeComponent(Component) */ public void removeComponent(Component c) { - c.setParent(null); - fireComponentDetachEvent(c); + if(c.getParent() == this) { + c.setParent(null); + fireComponentDetachEvent(c); + } } }