From 7b2423fe3d70411281bfd31c9d01b7ffac3867ab Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 18 Mar 2014 05:07:05 -0400 Subject: [PATCH] fix(worker-html) addAttributesToElement: attributes could be undefined --- lib/client/edit/worker-html.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/client/edit/worker-html.js b/lib/client/edit/worker-html.js index 4ffca0fb..af9766ab 100644 --- a/lib/client/edit/worker-html.js +++ b/lib/client/edit/worker-html.js @@ -7644,8 +7644,9 @@ function getAttribute(node, name) { SAXTreeBuilder.prototype.addAttributesToElement = function(element, attributes) { for (var i = 0; i < attributes.length; i++) { var attribute = attributes[i]; - if (!getAttribute(element, attribute.nodeName)) - element.attributes.push(attribute); + if (element.attributes) + if (!getAttribute(element, attribute.nodeName)) + element.attributes.push(attribute); } };