Skip to content

Commit

Permalink
Guard against missing first size
Browse files Browse the repository at this point in the history
  • Loading branch information
noisysocks committed Oct 13, 2022
1 parent ab52205 commit 6495837
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/components/src/font-size-picker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ const UnforwardedFontSizePicker = (
// operates in a legacy "unitless" mode where UnitControl can only be used
// to select px values and onChange() is always called with number values.
const hasUnits =
typeof value === 'string' || typeof fontSizes[ 0 ].size === 'string';
typeof value === 'string' || typeof fontSizes[ 0 ]?.size === 'string';

const [ valueNumber, valueUnit ] = parseNumberAndUnitFromSize( value );
const isValueUnitRelative =
Expand Down

0 comments on commit 6495837

Please sign in to comment.