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 authored and noahtallen committed Dec 15, 2023
1 parent a230a9e commit 638a4f3
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 638a4f3

@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 638a4f3.
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/7216060187
📝 Reported issues:

Please sign in to comment.