Skip to content

Commit 6495837

Browse files
committed
Guard against missing first size
1 parent ab52205 commit 6495837

File tree

1 file changed

+1
-1
lines changed
  • packages/components/src/font-size-picker

1 file changed

+1
-1
lines changed

packages/components/src/font-size-picker/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ const UnforwardedFontSizePicker = (
156156
// operates in a legacy "unitless" mode where UnitControl can only be used
157157
// to select px values and onChange() is always called with number values.
158158
const hasUnits =
159-
typeof value === 'string' || typeof fontSizes[ 0 ].size === 'string';
159+
typeof value === 'string' || typeof fontSizes[ 0 ]?.size === 'string';
160160

161161
const [ valueNumber, valueUnit ] = parseNumberAndUnitFromSize( value );
162162
const isValueUnitRelative =

0 commit comments

Comments
 (0)