Skip to content

Commit

Permalink
Guard against undefined content closer to parse() call
Browse files Browse the repository at this point in the history
  • Loading branch information
noisysocks committed Dec 20, 2022
1 parent 99551db commit d561493
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/customize-widgets/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export function widgetToBlock( { id, idBase, number, instance } ) {
} = instance;

if ( idBase === 'block' ) {
const parsedBlocks = parse( raw.content, {
const parsedBlocks = parse( raw.content ?? '', {
__unstableSkipAutop: true,
} );
block = parsedBlocks.length
Expand Down

1 comment on commit d561493

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3737644055
📝 Reported issues:

Please sign in to comment.