From 16c13456fa771431d9923f9e9af5526af466d239 Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Thu, 3 Aug 2023 09:51:15 +1000 Subject: [PATCH] Footnotes: Fix recursion into updating attributes when attributes is not an object (#53257) --- 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 ) {