Skip to content

Commit

Permalink
Site editor: find font families for typography presets crashes editor (
Browse files Browse the repository at this point in the history
…WordPress#59806)

* fontFamilies can be undefined. Use `! Array.isArray( fontFamilies )` to check.

Co-authored-by: ramonjd <[email protected]>
Co-authored-by: scruffian <[email protected]>
  • Loading branch information
3 people authored and carstingaxion committed Mar 27, 2024
1 parent ddfdbc4 commit 6676580
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/edit-site/src/components/global-styles/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function getVariationClassName( variation ) {
}

function getFontFamilyFromSetting( fontFamilies, setting ) {
if ( ! setting ) {
if ( ! Array.isArray( fontFamilies ) || ! setting ) {
return null;
}

Expand Down

0 comments on commit 6676580

Please sign in to comment.