diff --git a/src/Entity/BlockTranslation.php b/src/Entity/BlockTranslation.php index ed74e7a6c..3a0900924 100755 --- a/src/Entity/BlockTranslation.php +++ b/src/Entity/BlockTranslation.php @@ -94,7 +94,9 @@ public function getImage(): ?BlockImageInterface */ public function setImage(?BlockImageInterface $image): void { - $image->setOwner($this); + if ($image !== null) { + $image->setOwner($this); + } $this->image = $image; } diff --git a/src/Entity/PageTranslation.php b/src/Entity/PageTranslation.php index 5c8964687..995bbc3a9 100755 --- a/src/Entity/PageTranslation.php +++ b/src/Entity/PageTranslation.php @@ -104,7 +104,9 @@ public function getImage(): ?PageImageInterface */ public function setImage(?PageImageInterface $image): void { - $image->setOwner($this); + if ($image !== null) { + $image->setOwner($this); + } $this->image = $image; }