Fix crash in WooExpress Cart & Checkout Editor (https://github.com/woocommerce/woocommerce-blocks/pull/11024)
This commit is contained in:
parent
a7b5812703
commit
13024c88e6
|
@ -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 );
|
||||
|
|
Loading…
Reference in New Issue