Skip to content

Commit

Permalink
Fix TypeError when duplicating uncategorized theme patterns (#66889)
Browse files Browse the repository at this point in the history
* 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 cbravobernal committed Nov 19, 2024
1 parent 581d3cc commit ab68567
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 ab68567

Please sign in to comment.