Skip to content
This repository was archived by the owner on Oct 4, 2022. It is now read-only.
This repository was archived by the owner on Oct 4, 2022. It is now read-only.

authorName is null => Cannot read property 'length' of null #1198

Open
@goaround

Description

@goaround

Explanation

On my terms (categories, tags...) I always get the following error:

react-dom.min.js?ver=16.13.1:125 TypeError: Cannot read property 'length' of nullt FacebookSiteAndAuthorNames (FacebookSiteAndAuthorNames.js?6a79:66)

It happens because props.authorName is null on my sites and the functions check the props.authorName.length > 0:
https://github.com/goaround/javascript/blob/12520ef960f8c1f7789c337354f160a3fc3ac98c/packages/social-metadata-previews/src/facebook/FacebookSiteAndAuthorNames.js#L66

I would suggest to check first if props.authorName is not null before checking the length.

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