Skip to content

Commit

Permalink
Template Part: Fix 'isMissing' condition check (#37370)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka authored Dec 15, 2021
1 parent 8c7db03 commit b83239f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/block-library/src/template-part/edit/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* External dependencies
*/
import { isEmpty } from 'lodash';

/**
* WordPress dependencies
*/
Expand Down Expand Up @@ -99,7 +104,7 @@ export default function TemplatePartEdit( {
return {
innerBlocks: getBlocks( clientId ),
isResolved: hasResolvedEntity,
isMissing: hasResolvedEntity && ! entityRecord,
isMissing: hasResolvedEntity && isEmpty( entityRecord ),
defaultWrapper: defaultWrapperElement || 'div',
area: _area,
enableSelection: _enableSelection,
Expand Down

0 comments on commit b83239f

Please sign in to comment.