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 37ad06b commit b90e4c5
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 b90e4c5

@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 b90e4c5.
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/7216070445
📝 Reported issues:

Please sign in to comment.