diff --git a/packages/block-editor/src/hooks/color.js b/packages/block-editor/src/hooks/color.js index 75fad2274229e8..e8a638440189ed 100644 --- a/packages/block-editor/src/hooks/color.js +++ b/packages/block-editor/src/hooks/color.js @@ -185,7 +185,7 @@ export const withBlockControls = createHigherOrderComponent( }, }; const newNamedColor = - colorObject && colorObject.slug ? colorObject.slug : undefined; + colorObject?.slug ? colorObject.slug : undefined; props.setAttributes( { style: newStyle, [ attributeName ]: newNamedColor,