Skip to content

Commit

Permalink
Footnotes: Fix recursion into updating attributes when attributes is …
Browse files Browse the repository at this point in the history
…not an object (#53257)
  • Loading branch information
andrewserong authored and tellthemachines committed Aug 16, 2023
1 parent 2e0dad9 commit 39af331
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/core-data/src/entity-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down

0 comments on commit 39af331

Please sign in to comment.