Skip to content

Commit 71766f6

Browse files
prevent errors if upgrading and value is a number
1 parent 85c3c9d commit 71766f6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/util/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,9 @@ export const extractNumbersAndUnits = value => {
420420

421421
// Return only the CSS variable name given a CSS variable
422422
export const getCSSVarName = value => {
423+
if ( typeof value !== 'string' ) {
424+
return null
425+
}
423426
const match = value?.match( /var\(\s*([^,)\s]+)/ )
424427
return match ? match[ 1 ] : null
425428
}

0 commit comments

Comments
 (0)