Skip to content

Commit

Permalink
Check that the variation is an array before merging now that they can…
Browse files Browse the repository at this point in the history
… be filePaths (strings) as well
  • Loading branch information
tjcafferkey authored and ockham committed Jul 2, 2024
1 parent 7c4ba5e commit b745e05
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/blocks/src/store/process-block-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,14 @@ export const processBlockType =
save: () => null,
...bootstrappedBlockType,
...blockSettings,
// blockType.variations can be defined as a filePath.
variations: mergeBlockVariations(
bootstrappedBlockType?.variations,
blockSettings?.variations
Array.isArray( bootstrappedBlockType?.variations )
? bootstrappedBlockType.variations
: [],
Array.isArray( blockSettings?.variations )
? blockSettings.variations
: []
),
};

Expand Down

0 comments on commit b745e05

Please sign in to comment.