Make {{#if foo}} handle empty Arrays

This commit is contained in:
wycats
2010-12-28 15:47:15 -08:00
parent 79f6b35258
commit 9a1d7c018d
+1 -1
View File
@@ -91,7 +91,7 @@ Handlebars.registerHelper('each', function(context, fn, inverse) {
}); });
Handlebars.registerHelper('if', function(context, fn, inverse) { Handlebars.registerHelper('if', function(context, fn, inverse) {
if(context === false || context == null) { if(!context || context === []) {
return inverse(this); return inverse(this);
} else { } else {
return fn(this); return fn(this);