Skip to content

Commit 6671676

Browse files
committed
Update xml2json.js
xml.attributes are null in IE11, added test to fix.
1 parent e7c8242 commit 6671676

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/xml2json.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
}
117117

118118
var root = {};
119-
if (typeof xml.attributes === 'undefined') {
119+
if (typeof xml.attributes === 'undefined' || xml.attributes === null) {
120120
root[xml.nodeName] = xml2jsonImpl(xml, options);
121121
} else if (xml.attributes.length === 0 && xml.childElementCount === 0){
122122
root[xml.nodeName] = normalize(xml.textContent, options);

0 commit comments

Comments
 (0)