Skip to content

Commit

Permalink
Skip JSON.parse for empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix authored and tellthemachines committed Jun 23, 2023
1 parent 165a353 commit 9141d40
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core-data/src/entity-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ export function useEntityBlockEditor( kind, name, { id: _id } = {} ) {
}
}

const footnotes = JSON.parse( meta.footnotes || '[]' );
const footnotes = meta.footnotes
? JSON.parse( meta.footnotes )
: [];
const currentOrder = footnotes.map( ( fn ) => fn.id );

if ( currentOrder.join( '' ) === newOrder.join( '' ) ) return;
Expand Down

0 comments on commit 9141d40

Please sign in to comment.