From 3f0fe72a6d13429ff8cf6e435541ec7fa7283c86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= Date: Thu, 8 Jul 2021 17:51:21 +0200 Subject: [PATCH] Defensive handling of null values for color.palette and color.duotone --- packages/block-editor/src/hooks/duotone.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/block-editor/src/hooks/duotone.js b/packages/block-editor/src/hooks/duotone.js index bfd008586786c6..18a56c2b5f1494 100644 --- a/packages/block-editor/src/hooks/duotone.js +++ b/packages/block-editor/src/hooks/duotone.js @@ -130,8 +130,8 @@ function DuotonePanel( { name, attributes, setAttributes } ) { if ( ! hasBlockSupport( name, 'color.__experimentalDuotone' ) || - ( duotonePalette?.length === 0 && - colorPalette?.length === 0 && + ( ( ! duotonePalette || duotonePalette?.length === 0 ) && + ( ! colorPalette || colorPalette?.length === 0 ) && disableCustomColors ) ) { return null;