mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
🐛 Fixed error from has helper w/o dependent data
no-issue Usage of the has helper like `{{#has 'author:count>1'}}` when the current context does not have the dependent data (in this case `authors`) would error, because it could not read property length of undefined.
This commit is contained in:
parent
953bd2a2fc
commit
d78cbed84d
1 changed files with 3 additions and 0 deletions
|
@ -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+/)) {
|
||||
|
|
Loading…
Reference in a new issue