Avoid errors that happen if you try to remove a non-element child from a webComponent

This commit is contained in:
nathan 2022-08-02 16:37:01 -06:00
parent d438b4e355
commit 1a8c1c2d35

View File

@ -296,7 +296,7 @@ export class et2_widget extends ClassWithAttributes
}
// Remove this element from the parent, if it exists
if (typeof this._parent != "undefined" && this._parent !== null)
if(typeof this._parent != "undefined" && this._parent !== null && this._parent instanceof et2_widget)
{
this._parent.removeChild(this);
}