From 9a1d7c018d171bed68ba3449b697fc087c6bd7f1 Mon Sep 17 00:00:00 2001 From: wycats Date: Tue, 28 Dec 2010 15:47:15 -0800 Subject: [PATCH] Make {{#if foo}} handle empty Arrays --- 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 5e5e37e2..d1e44452 100644 --- a/lib/handlebars/compiler.js +++ b/lib/handlebars/compiler.js @@ -91,7 +91,7 @@ Handlebars.registerHelper('each', function(context, fn, inverse) { }); Handlebars.registerHelper('if', function(context, fn, inverse) { - if(context === false || context == null) { + if(!context || context === []) { return inverse(this); } else { return fn(this);