Skip to content

Commit

Permalink
Make sure blockType is defined before trying to use it (WordPress#63351)
Browse files Browse the repository at this point in the history
Co-authored-by: mattsherman <mattormeeple@git.wordpress.org>
  • Loading branch information
2 people authored and carstingaxion committed Jul 18, 2024
1 parent 24a6d45 commit d584955
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/block-editor/src/components/inner-blocks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ function UncontrolledInnerBlocks( props ) {
/>
);

if ( Object.keys( blockType.providesContext ).length === 0 ) {
if (
! blockType?.providesContext ||
Object.keys( blockType.providesContext ).length === 0
) {
return items;
}

Expand Down

0 comments on commit d584955

Please sign in to comment.