summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/helpers/each.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/handlebars/helpers/each.js')
-rw-r--r--lib/handlebars/helpers/each.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/handlebars/helpers/each.js b/lib/handlebars/helpers/each.js
index 9fc5a09..d39a300 100644
--- a/lib/handlebars/helpers/each.js
+++ b/lib/handlebars/helpers/each.js
@@ -25,6 +25,12 @@ export default function(instance) {
}
function execIteration(field, index, last) {
+ // Don't iterate over undefined values since we can't execute blocks against them
+ // in non-strict (js) mode.
+ if (context[field] == null) {
+ return;
+ }
+
if (data) {
data.key = field;
data.index = index;