We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e7c8242 commit 2ffc89fCopy full SHA for 2ffc89f
src/xml2json.js
@@ -118,7 +118,7 @@
118
var root = {};
119
if (typeof xml.attributes === 'undefined') {
120
root[xml.nodeName] = xml2jsonImpl(xml, options);
121
- } else if (xml.attributes.length === 0 && xml.childElementCount === 0){
+ } else if (xml.attributes && xml.attributes.length === 0 && xml.childElementCount === 0){
122
root[xml.nodeName] = normalize(xml.textContent, options);
123
} else {
124
0 commit comments