From 65a9b4c79c8a661ba2a165f8221c5bb8b5ee6993 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 3 Dec 2014 00:16:39 +0000 Subject: [PATCH] Avoid errors if getWidgetById() is called on a cleared widget / template --- etemplate/js/et2_core_widget.js | 1 + 1 file changed, 1 insertion(+) diff --git a/etemplate/js/et2_core_widget.js b/etemplate/js/et2_core_widget.js index cc1fdf5fcf..820be2361f 100644 --- a/etemplate/js/et2_core_widget.js +++ b/etemplate/js/et2_core_widget.js @@ -393,6 +393,7 @@ var et2_widget = ClassWithAttributes.extend( { return this; } + if(!this._children) return null; for (var i = 0; i < this._children.length; i++) {