Skip to content

Commit 2e33a46

Browse files
fix old design library entries will encounter an error when being added if the color string value is undefined
1 parent b282f50 commit 2e33a46

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/util/colors.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ export const extractColor = value => {
9090
* @return {string} color in #RRGGBBAA format
9191
*/
9292
export const colorOpacityToHexAplha = ( color, opacity ) => {
93+
if ( ! color ) {
94+
return ''
95+
}
9396
if ( color.startsWith( '#' ) ) {
9497
// Get the first 6 hex digits.
9598
const hex = color.slice( 0, 7 )

0 commit comments

Comments
 (0)