Skip to content
This repository has been archived by the owner on Oct 23, 2022. It is now read-only.

Commit

Permalink
Don't try to call function childNamed on XmlTextNode.
Browse files Browse the repository at this point in the history
This fixes #94 and #97.
  • Loading branch information
amtrack committed Oct 19, 2017
1 parent 262b2ed commit fb77db6
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions lib/metadata-file-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,20 @@ MetadataFileContainer.prototype.parse = function() {
var childType = describeMetadataService.getType(childXmlName);
var childTypeName = childType.xmlName;
parsed.childrenNamed(childType.tagName).forEach(function(field) {
var childMember = field.childNamed(childType.key);
if (childMember && childMember.val) {
self.components.push(new MetadataFileComponent({
fullName: childType.notCustomObjectRelated ? childMember.val : objectName + '.' + childMember.val,
type: childTypeName,
contents: " " + field.toString({
compressed: true,
trimmed: false,
preserveWhitespace: true
}),
parent: type
}));
if (typeof field['childNamed'] === 'function') {
var childMember = field.childNamed(childType.key);
if (childMember && childMember.val) {
self.components.push(new MetadataFileComponent({
fullName: childType.notCustomObjectRelated ? childMember.val : objectName + '.' + childMember.val,
type: childTypeName,
contents: " " + field.toString({
compressed: true,
trimmed: false,
preserveWhitespace: true
}),
parent: type
}));
}
}
});
});
Expand Down

0 comments on commit fb77db6

Please sign in to comment.