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 14, 2023
1 parent cede1a7 commit ab04074
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 ab04074

Please sign in to comment.