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

Update FacebookSiteAndAuthorNames.js #1199

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function renderFacebookAuthorName( authorName ) {
* @returns {React.Element} The rendered element.
*/
const FacebookSiteAndAuthorNames = ( props ) => {
const hasAuthorName = props.authorName.length > 0;
const hasAuthorName = props.authorName && props.authorName.length > 0;
const screenReaderText = hasAuthorName
/* Translators: 1: site name, 2: post author name */
? sprintf( __( "%1$s by %2$s", "yoast-components" ), props.siteUrl, props.authorName )
Expand Down