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 committed Jun 25, 2024
1 parent fa4c058 commit 74e0b93
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 74e0b93

Please sign in to comment.