Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Fix crash in WooExpress Cart & Checkout Editor
Browse files Browse the repository at this point in the history
  • Loading branch information
tarhi-saad committed Sep 21, 2023
1 parent 102ed59 commit bda1254
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ export const useForcedLayout = ( {
const { replaceInnerBlocks } = dispatch( 'core/block-editor' );

return registry.subscribe( () => {
const currentBlock = registry
.select( 'core/block-editor' )
.getBlock( clientId );

// If the block is removed we shouldn't reinsert its inner blocks.
if ( ! currentBlock ) {
return;
}

const innerBlocks = registry
.select( 'core/block-editor' )
.getBlocks( clientId );
Expand Down

0 comments on commit bda1254

Please sign in to comment.