summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler.js
diff options
context:
space:
mode:
authorwycats <wycats@gmail.com>2010-12-21 09:46:22 -0800
committerwycats <wycats@gmail.com>2010-12-21 09:46:22 -0800
commite0246d7dfc93fc35d3bd8fe6bdd71bb038df0033 (patch)
tree1319fa86f1a5277380a715d47be6144a535a23e5 /lib/handlebars/compiler.js
parentfc0d721b96faca5e7af52110acaa68094ea31d26 (diff)
downloadhandlebars.js-e0246d7dfc93fc35d3bd8fe6bdd71bb038df0033.zip
handlebars.js-e0246d7dfc93fc35d3bd8fe6bdd71bb038df0033.tar.gz
handlebars.js-e0246d7dfc93fc35d3bd8fe6bdd71bb038df0033.tar.bz2
#each should handle undefined or null values
Diffstat (limited to 'lib/handlebars/compiler.js')
-rw-r--r--lib/handlebars/compiler.js2
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]);
}