diff --git a/core/frontend/helpers/has.js b/core/frontend/helpers/has.js index 683c699557..a577d4d05b 100644 --- a/core/frontend/helpers/has.js +++ b/core/frontend/helpers/has.js @@ -11,6 +11,9 @@ var proxy = require('./proxy'), validAttrs = ['tag', 'author', 'slug', 'id', 'number', 'index', 'any', 'all']; function handleCount(ctxAttr, data) { + if (!data || !_.isFinite(data.length)) { + return false; + } let count; if (ctxAttr.match(/count:\d+/)) {