From e0246d7dfc93fc35d3bd8fe6bdd71bb038df0033 Mon Sep 17 00:00:00 2001 From: wycats Date: Tue, 21 Dec 2010 09:46:22 -0800 Subject: [PATCH] #each should handle undefined or null values --- lib/handlebars/compiler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/handlebars/compiler.js b/lib/handlebars/compiler.js index d22a0d4a..655dcd3a 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