Skip to content

Commit

Permalink
Fix test case given an invalid block without a source.
Browse files Browse the repository at this point in the history
Potentially this is a conflict with #38794 and once `isValidBlockContent`
is gone we might be able to remove this change.
  • Loading branch information
dmsnell committed Mar 9, 2022
1 parent 567dbae commit 22cb97e
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
} from '@wordpress/element';
import {
getBlockType,
getSaveContent,
isUnmodifiedDefaultBlock,
serializeRawBlock,
} from '@wordpress/blocks';
Expand Down Expand Up @@ -156,7 +157,9 @@ function BlockListBlock( {
let block;

if ( ! isValid ) {
const saveContent = serializeRawBlock( source );
const saveContent = source
? serializeRawBlock( source )
: getSaveContent( blockType, attributes );

block = (
<Block className="has-warning">
Expand Down

0 comments on commit 22cb97e

Please sign in to comment.