Skip to content

Commit

Permalink
Make {{#if foo}} handle empty Arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
wycats committed Dec 28, 2010
1 parent 79f6b35 commit 9a1d7c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/handlebars/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9a1d7c0

Please sign in to comment.