have a guard on a handlebars helper.
This commit is contained in:
parent
ebe7a302b6
commit
66352c8bad
1 changed files with 4 additions and 0 deletions
|
|
@ -15,6 +15,10 @@ Handlebars.registerHelper('linkToPerson', function(context, block) {
|
|||
})
|
||||
|
||||
Handlebars.registerHelper('personImage', function(person, size, imageClass) {
|
||||
/* we return here if person.avatar is blank, because this happens when a
|
||||
* user is unauthenticated. we don't know why this happens... */
|
||||
if(typeof(person.avatar) == "undefined") { return }
|
||||
|
||||
size = (typeof(size) != "string" ? "small" : size);
|
||||
imageClass = (typeof(imageClass) != "string" ? size : imageClass);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue