fix replacing an initial comment in accompanying period

This commit is contained in:
2021-05-18 19:19:22 +02:00
parent 30c53b17f7
commit 8e95166c24
2 changed files with 11 additions and 3 deletions

View File

@@ -394,9 +394,10 @@ class AccompanyingPeriod
*/
public function setInitialComment(?Comment $comment = null): self
{
if (NULL === $comment && NULL !== $this->initialComment) {
if (NULL !== $this->initialComment) {
$this->removeComment($this->initialComment);
} elseif ($comment instanceof Comment) {
}
if ($comment instanceof Comment) {
$this->addComment($comment);
}