diff --git a/src/node/basic-node.js b/src/node/basic-node.js index 7c67c9a2..d5c4b3c9 100644 --- a/src/node/basic-node.js +++ b/src/node/basic-node.js @@ -22,6 +22,10 @@ class Node { * @return {Boolean} Whether there is a child node of given type */ contains(type) { + if (!Array.isArray(this.content)) { + return false; + } + return this.content.some(function(node) { return node.type === type; });