diff --git a/assets/js/atomic/utils/blocks-registration-manager/blocks-registration-manager.ts b/assets/js/atomic/utils/blocks-registration-manager/blocks-registration-manager.ts index 79446bd91e3..7ca69ae89e4 100644 --- a/assets/js/atomic/utils/blocks-registration-manager/blocks-registration-manager.ts +++ b/assets/js/atomic/utils/blocks-registration-manager/blocks-registration-manager.ts @@ -1,3 +1,8 @@ +/** + * External dependencies + */ +import { getBlockType } from '@wordpress/blocks'; + /** * Internal dependencies */ @@ -108,6 +113,11 @@ export class BlockRegistrationManager ) { continue; } + + if ( ! getBlockType( blockWithRestrictionName ) ) { + continue; + } + this.blockRegistrationStrategy = BLOCKS_WITH_RESTRICTION[ blockWithRestrictionName ].isVariationBlock @@ -130,6 +140,10 @@ export class BlockRegistrationManager */ registerBlocksAfterLeavingRestrictedArea() { for ( const unregisteredBlockName of this.unregisteredBlocks ) { + if ( ! getBlockType( unregisteredBlockName ) ) { + continue; + } + const restrictedBlockData = BLOCKS_WITH_RESTRICTION[ unregisteredBlockName ]; this.blockRegistrationStrategy = BLOCKS_WITH_RESTRICTION[