Viima/jquery-comments

hasAttachments function should test if attachments property exists

Opened this issue ยท 0 comments

I propose to change

commentModel.hasAttachments = function() {
    return commentModel.attachments.length > 0;
}

to

commentModel.hasAttachments = function() {
    return !!commentModel.attachments && commentModel.attachments.length > 0;
}

as commentModel does not always contain attachments property ๐Ÿ‘