#each should handle undefined or null values
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user