Skip to content

Commit

Permalink
Command Palette: Fix a crash when transform to a block without icon (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano authored and Siobhan committed Oct 28, 2023
1 parent f28647d commit b95ea5d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
/**
* Internal dependencies
*/
import BlockIcon from '../block-icon';
import { store as blockEditorStore } from '../../store';

export const useTransformCommands = () => {
Expand Down Expand Up @@ -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: <BlockIcon icon={ icon } />,
callback: ( { close } ) => {
onBlockTransform( name );
close();
Expand Down

0 comments on commit b95ea5d

Please sign in to comment.