Skip to content

Commit 38e850e

Browse files
committed
fix NaturalIntelligence#126: check for Array type
1 parent 86aa1e6 commit 38e850e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fast-xml-parser",
3-
"version": "3.12.5",
3+
"version": "3.12.6",
44
"description": "Validate XML or Parse XML to JS/JSON very fast without C/C++ based libraries",
55
"main": "./src/parser.js",
66
"scripts": {

src/xmlNode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = function(tagname, parent, val) {
77
this.attrsMap = {};//attributes map
88
this.val = val;//text only
99
this.addChild = function(child) {
10-
if (this.child[child.tagname]) {//already presents
10+
if ( Array.isArray(this.child[child.tagname]) ){//already presents
1111
this.child[child.tagname].push(child);
1212
} else {
1313
this.child[child.tagname] = [child];

0 commit comments

Comments
 (0)