fix form and take null cases into account

This commit is contained in:
2022-05-04 12:30:44 +02:00
parent 784a725ce3
commit 416a88b93d
3 changed files with 9 additions and 2 deletions

View File

@@ -51,7 +51,10 @@ class PrivateCommentEmbeddable
public function merge(PrivateCommentEmbeddable $newComment): self
{
$mergedComments = $newComment->getComments() + $this->getComments();
$currentComments = null === $this->getComments() ? [] : $this->getComments();
$mergedComments = $newComment->getComments() + $currentComments;
$this->setComments($mergedComments);