diff options
-rw-r--r-- | lib/handlebars/compiler.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/handlebars/compiler.js b/lib/handlebars/compiler.js index d22a0d4..655dcd3 100644 --- a/lib/handlebars/compiler.js +++ b/lib/handlebars/compiler.js @@ -81,7 +81,7 @@ Handlebars.registerHelper('blockHelperMissing', function(context, fn, inverse) { Handlebars.registerHelper('each', function(context, fn, inverse) { var ret = ""; - if(context.length > 0) { + if(context && context.length > 0) { for(var i=0, j=context.length; i<j; i++) { ret = ret + fn(context[i]); } |