From b745e0577616575dcde76377b31db0a45d0a126a Mon Sep 17 00:00:00 2001 From: Tom Cafferkey Date: Tue, 25 Jun 2024 10:47:00 +0100 Subject: [PATCH] Check that the variation is an array before merging now that they can be filePaths (strings) as well --- packages/blocks/src/store/process-block-type.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/blocks/src/store/process-block-type.js b/packages/blocks/src/store/process-block-type.js index 154f74c6ab7296..9c171f2c7e0f4e 100644 --- a/packages/blocks/src/store/process-block-type.js +++ b/packages/blocks/src/store/process-block-type.js @@ -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 + : [] ), };