Skip to content

Commit ca04999

Browse files
committed
Footnotes: Fix recursion into updating attributes when attributes is not an object
1 parent dc6bd91 commit ca04999

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/core-data/src/entity-provider.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,15 @@ export function useEntityBlockEditor( kind, name, { id: _id } = {} ) {
221221
);
222222

223223
function updateAttributes( attributes ) {
224+
// Only attempt to update attributes, if attributes is an object.
225+
if (
226+
! attributes ||
227+
Array.isArray( attributes ) ||
228+
typeof attributes !== 'object'
229+
) {
230+
return attributes;
231+
}
232+
224233
attributes = { ...attributes };
225234

226235
for ( const key in attributes ) {

0 commit comments

Comments
 (0)