Skip to content

Commit

Permalink
Guard block component against zombie state bug (#17092)
Browse files Browse the repository at this point in the history
* Guard block component against zombie state bug
  • Loading branch information
senadir committed Aug 19, 2019
1 parent df7afa8 commit dc659b5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/block-editor/src/components/block-list/block.js
Expand Up @@ -29,7 +29,7 @@ import {
withSelect,
} from '@wordpress/data';
import { withViewportMatch } from '@wordpress/viewport';
import { compose, pure } from '@wordpress/compose';
import { compose, pure, ifCondition } from '@wordpress/compose';

/**
* Internal dependencies
Expand Down Expand Up @@ -775,5 +775,8 @@ export default compose(
withViewportMatch( { isLargeViewport: 'medium' } ),
applyWithSelect,
applyWithDispatch,
// block is sometimes not mounted at the right time, causing it be undefined
// see issue for more info https://github.com/WordPress/gutenberg/issues/17013
ifCondition( ( { block } ) => !! block ),
withFilters( 'editor.BlockListBlock' )
)( BlockListBlock );

0 comments on commit dc659b5

Please sign in to comment.