Commit 676442fe authored by svendecabooter's avatar svendecabooter Committed by miro_dietiker

Issue #2841650 by svendecabooter: Fix exceptions for non-existing entity in...

Issue #2841650 by svendecabooter: Fix exceptions for non-existing entity in migrate destination plugin rollback()
parent 2de47b96
......@@ -141,11 +141,13 @@ class EntityReferenceRevisions extends EntityRevision {
protected function rollbackNonTranslation(array $destination_identifiers) {
$revision_id = array_pop($destination_identifiers);
$entity = $this->storage->loadRevision($revision_id);
if ($entity->isDefaultRevision()) {
$entity->delete();
}
else {
$this->storage->deleteRevision($revision_id);
if ($entity) {
if ($entity->isDefaultRevision()) {
$entity->delete();
}
else {
$this->storage->deleteRevision($revision_id);
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment