From 961d1a82beb7d66f76c661bf63d2ac572c90341d Mon Sep 17 00:00:00 2001 From: Tetsuaki Hamano Date: Sat, 28 Oct 2023 16:27:59 +0900 Subject: [PATCH] Command Palette: Fix a crash when transform to a block without icon --- .../block-editor/src/components/use-block-commands/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/use-block-commands/index.js b/packages/block-editor/src/components/use-block-commands/index.js index 9dfc4a6df9ff9f..0ef1a83411026a 100644 --- a/packages/block-editor/src/components/use-block-commands/index.js +++ b/packages/block-editor/src/components/use-block-commands/index.js @@ -22,6 +22,7 @@ import { /** * Internal dependencies */ +import BlockIcon from '../block-icon'; import { store as blockEditorStore } from '../../store'; export const useTransformCommands = () => { @@ -100,7 +101,7 @@ export const useTransformCommands = () => { name: 'core/block-editor/transform-to-' + name.replace( '/', '-' ), // translators: %s: block title/name. label: sprintf( __( 'Transform to %s' ), title ), - icon: icon.src, + icon: , callback: ( { close } ) => { onBlockTransform( name ); close();