Skip to content
Browse files

Call parent only if it has blocks defined

  • Loading branch information...
1 parent 2670e39 commit 5758a0f4a5bb996f098b7bbf33764d9d18ad208f @Almad Almad committed Sep 3, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/parser.js
View
2 lib/parser.js
@@ -353,7 +353,7 @@ exports.compile = function compile(indent, parentBlock, context) {
throw new Error('Block "' + blockname + '" found nested in another block tag on line' + token.line + '.');
}
try {
- if (this.hasOwnProperty('parent') && this.parent.blocks.hasOwnProperty(blockname)) {
+ if (this.hasOwnProperty('parent') && this.parent.blocks && this.parent.blocks.hasOwnProperty(blockname)) {
this.blocks[blockname] = compile.call(token, indent + ' ', this.parent.blocks[blockname]);
} else if (this.hasOwnProperty('blocks')) {
this.blocks[blockname] = compile.call(token, indent + ' ');

0 comments on commit 5758a0f

Please sign in to comment.
Something went wrong with that request. Please try again.