From ab04074d185e6691128edb2b69875d50916ac6c0 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 6cc1e021841b4..3039105d7c55c 100644 --- a/packages/core-data/src/entity-provider.js +++ b/packages/core-data/src/entity-provider.js @@ -229,6 +229,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 ) {