Skip to content

Commit 82e6464

Browse files
committed
Ensure attributes is always an object, never null or undefined
1 parent 09e1eb4 commit 82e6464

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/blocks/src/store/process-block-type.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,14 @@ export const processBlockType =
103103
),
104104
};
105105

106+
// Ensure attributes is always an object, never null or undefined.
107+
if (
108+
! blockType.attributes ||
109+
typeof blockType.attributes !== 'object'
110+
) {
111+
blockType.attributes = {};
112+
}
113+
106114
const settings = applyFilters(
107115
'blocks.registerBlockType',
108116
blockType,

0 commit comments

Comments
 (0)