Skip to content

Commit

Permalink
return empty array if blocks data is not available in `core/block-edi…
Browse files Browse the repository at this point in the history
…tor`
  • Loading branch information
FAMarfuaty committed Oct 9, 2023
1 parent 1c10682 commit e4e3421
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/js/src/analysis/collectAnalysisData.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function collectAnalysisData( editorData, store, customAnalysisDa
// Retrieve the block editor blocks from WordPress and filter on useful information.
let blocks = null;
if ( blockEditorDataModule ) {
blocks = blockEditorDataModule.getBlocks();
blocks = blockEditorDataModule.getBlocks() || [];
blocks = blocks.filter( block => block.isValid );
}

Expand Down

0 comments on commit e4e3421

Please sign in to comment.