From ca04999f589091f270d584e956420a16cc529aa7 Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Wed, 2 Aug 2023 15:20:30 +1000 Subject: [PATCH] Footnotes: Fix recursion into updating attributes when attributes is not an object --- packages/core-data/src/entity-provider.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/core-data/src/entity-provider.js b/packages/core-data/src/entity-provider.js index fad9fe693a575b..cf15c423456a29 100644 --- a/packages/core-data/src/entity-provider.js +++ b/packages/core-data/src/entity-provider.js @@ -221,6 +221,15 @@ export function useEntityBlockEditor( kind, name, { id: _id } = {} ) { ); function updateAttributes( attributes ) { + // Only attempt to update attributes, if attributes is an object. + if ( + ! attributes || + Array.isArray( attributes ) || + typeof attributes !== 'object' + ) { + return attributes; + } + attributes = { ...attributes }; for ( const key in attributes ) {