diff --git a/packages/blocks/src/store/selectors.js b/packages/blocks/src/store/selectors.js index d625aae744691..4c3d8252129d3 100644 --- a/packages/blocks/src/store/selectors.js +++ b/packages/blocks/src/store/selectors.js @@ -712,7 +712,8 @@ export function isMatchingSearchTerm( state, nameOrType, searchTerm ) { isSearchMatch( blockType.title ) || some( blockType.keywords, isSearchMatch ) || isSearchMatch( blockType.category ) || - isSearchMatch( blockType.description ) + ( typeof blockType.description === 'string' && + isSearchMatch( blockType.description ) ) ); } diff --git a/packages/blocks/src/store/test/selectors.js b/packages/blocks/src/store/test/selectors.js index e8eed9958c45e..8793e1e354e44 100644 --- a/packages/blocks/src/store/test/selectors.js +++ b/packages/blocks/src/store/test/selectors.js @@ -605,6 +605,10 @@ describe( 'selectors', () => { ...blockTypeBase, category, }; + const blockTypeWithNonStringDescription = { + ...blockTypeBase, + description: