Skip to content

hasAttachments function should test if attachments property exists #184

@dk-teknologisk-osv

Description

@dk-teknologisk-osv

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 👍

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions