Skip to content

Commit

Permalink
Fix block inserter WSOD when an empty reusable block exists (#26484)
Browse files Browse the repository at this point in the history
  • Loading branch information
noahtallen authored and tellthemachines committed Oct 30, 2020
1 parent 8909be3 commit dae7452
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/block-editor/src/store/selectors.js
Expand Up @@ -1697,7 +1697,11 @@ export const __experimentalGetParsedReusableBlock = createSelector(

// Only reusableBlock.content.raw should be used here, `reusableBlock.content` is a
// workaround until #22127 is fixed.
return parse( reusableBlock.content.raw || reusableBlock.content );
return parse(
typeof reusableBlock.content.raw === 'string'
? reusableBlock.content.raw
: reusableBlock.content
);
},
( state ) => [ getReusableBlocks( state ) ]
);
Expand Down

0 comments on commit dae7452

Please sign in to comment.