Skip to content

Commit

Permalink
Fix: Global Styles getNodesWithStyles expects an object with elements. (
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta authored Mar 13, 2023
1 parent a2e91a4 commit 917afa4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,9 @@ export const getNodesWithStyles = ( tree, blockSelectors ) => {
}

Object.entries( ELEMENTS ).forEach( ( [ name, selector ] ) => {
if ( !! tree.styles?.elements[ name ] ) {
if ( !! tree.styles?.elements?.[ name ] ) {
nodes.push( {
styles: tree.styles?.elements[ name ],
styles: tree.styles?.elements?.[ name ],
selector,
} );
}
Expand Down

1 comment on commit 917afa4

@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 917afa4.
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/4408007590
📝 Reported issues:

Please sign in to comment.