From 0285ea4b28e373d24ecd7cb9e370cca36040e8b6 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 29 May 2013 18:57:48 +0000 Subject: [PATCH] Avoid errors removing top-level widgets, check for parent property first --- etemplate/js/et2_core_widget.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etemplate/js/et2_core_widget.js b/etemplate/js/et2_core_widget.js index 110bd6d1be..e3dad12372 100644 --- a/etemplate/js/et2_core_widget.js +++ b/etemplate/js/et2_core_widget.js @@ -233,8 +233,8 @@ var et2_widget = Class.extend( this._children[i].free(); } - // Remove this element from the parent - if (this._parent !== null) + // Remove this element from the parent, if it exists + if (typeof this._parent != "undefined" && this._parent !== null) { this._parent.removeChild(this); }