Problem/Motivation
TypeError: get_class(): Argument #1 ($object) must be of type object, null given
in EntityStorageBase.php line 655
Steps to reproduce
- Create a workspace
- Create content inside the workspace
- Delete that content through another process
- Delete the workspace — error is thrown during purge
Problem code : WorkspaceManager.php line 364:
$associated_entity_storage->delete([$associated_entity_storage->load($initial_revision_ids[$revision_id])]);
load() returns null for a deleted entity, but nothing checks for that before calling delete().
Proposed resolution
$entity = $associated_entity_storage->load($initial_revision_ids[$revision_id]);
if ($entity) {
$associated_entity_storage->delete([$entity]);
}
Comments