Skip to content

Commit

Permalink
(edit-site)(use-init-edited-entity-from-url) Safely access `toString(…
Browse files Browse the repository at this point in the history
…)` on `siteData`'s `page_on_front` (#57035)
  • Loading branch information
fullofcaffeine committed Dec 14, 2023
1 parent aecb607 commit ea2ee60
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ function useResolveEditedEntityAndContext( { postId, postType } ) {
return {
hasLoadedAllDependencies: !! base && !! siteData,
homepageId:
siteData?.show_on_front === 'page'
siteData?.show_on_front === 'page' &&
[ 'number', 'string' ].includes(
typeof siteData.page_on_front
)
? siteData.page_on_front.toString()
: null,
url: base?.home,
Expand Down

1 comment on commit ea2ee60

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in ea2ee60.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7212960540
📝 Reported issues:

Please sign in to comment.