Skip to content

Commit

Permalink
Merge pull request #120 from trufae/null-node-entry
Browse files Browse the repository at this point in the history
Handle <null /> nodes when parsing plist
  • Loading branch information
mreinstein authored Apr 26, 2022
2 parents d48c5a0 + 6f931a0 commit c1a299b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ function parsePlistXML (node) {
)
return new Date(node.childNodes[0].nodeValue);

} else if (node.nodeName === 'null') {
return null;

} else if (node.nodeName === 'true') {
return true;

Expand Down
2 changes: 1 addition & 1 deletion test/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('parse()', function () {
describe('null', function () {
it('should parse a <null> node into a null value', function () {
var parsed = parseFixture('<null/>');
assert.strictEqual(parsed, undefined);
assert.strictEqual(parsed, null);
});
});

Expand Down

0 comments on commit c1a299b

Please sign in to comment.