diff --git a/packages/edit-widgets/src/store/actions.js b/packages/edit-widgets/src/store/actions.js index 7ae0bb06d65324..d31280c0a0133b 100644 --- a/packages/edit-widgets/src/store/actions.js +++ b/packages/edit-widgets/src/store/actions.js @@ -140,7 +140,9 @@ export function* saveWidgetArea( widgetAreaId ) { // since order is important. sidebarWidgetsIds.push( widgetId ); - if ( widgetId ) { + // We need to check for the id in the widget object here, because a deleted + // and restored widget won't have this id. + if ( widget.id ) { yield dispatch( 'core', 'editEntityRecord',