fix(worker-html) addAttributesToElement: attributes could be undefined

This commit is contained in:
coderaiser 2014-03-18 05:07:05 -04:00
parent 13d11d79cf
commit 7b2423fe3d

View file

@ -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);
}
};