From de2c9756f1b752f8d64ed8b703c3eb5a879ab9c9 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 6 Feb 2013 10:47:31 +0000 Subject: [PATCH] Avoid an additional javascript error in case of 404 --- etemplate/js/et2_core_xml.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/etemplate/js/et2_core_xml.js b/etemplate/js/et2_core_xml.js index 656306c622..9ac87ff998 100644 --- a/etemplate/js/et2_core_xml.js +++ b/etemplate/js/et2_core_xml.js @@ -62,8 +62,11 @@ function et2_loadXMLFromURL(_url, _callback, _context) xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4) { - var xmldoc = xmlhttp.responseXML.documentElement; - _callback.call(_context, xmldoc); + if(xmlhttp.responseXML) + { + var xmldoc = xmlhttp.responseXML.documentElement; + _callback.call(_context, xmldoc); + } } }