Skip to content

Commit

Permalink
Fix TypeError when duplicating uncategorized theme patterns (WordPres…
Browse files Browse the repository at this point in the history
…s#66889)

* Fix TypeError when duplicating uncategorized patterns
Only try to match the pattern categories and get the category label if the theme pattern uses the optional `categories` parameter.

Co-authored-by: carolinan <[email protected]>
Co-authored-by: ntsekouras <[email protected]>
Co-authored-by: getdave <[email protected]>
  • Loading branch information
4 people authored and karthick-murugan committed Nov 13, 2024
1 parent ba5f803 commit d3e4e83
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function getTermLabels( pattern, categories ) {
if ( pattern.type !== PATTERN_TYPES.user ) {
return categories.core
?.filter( ( category ) =>
pattern.categories.includes( category.name )
pattern.categories?.includes( category.name )
)
.map( ( category ) => category.label );
}
Expand Down

0 comments on commit d3e4e83

Please sign in to comment.