Skip to content

Commit

Permalink
patch bug in validate method
Browse files Browse the repository at this point in the history
  • Loading branch information
jescalan committed Aug 19, 2016
1 parent e3bd40e commit 33b2b92
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function validateNode (node) {
}

if (node.type === 'tag') {
if (!Array.isArray(node.content)) {
if (node.content && !Array.isArray(node.content)) {
throw new UtilError("tag node's content must be an array", node)
}

Expand All @@ -69,7 +69,7 @@ function validateNode (node) {
}

if (node.type === 'text' || node.type === 'comment' || node.type === 'code') {
if (typeof node.content !== 'string') {
if (node.content && typeof node.content !== 'string') {
throw new UtilError(`${node.type} node contents should be a string`, node)
}
}
Expand Down

0 comments on commit 33b2b92

Please sign in to comment.