diff --git a/src/Bundle/ChillActivityBundle/Entity/Activity.php b/src/Bundle/ChillActivityBundle/Entity/Activity.php index 6b69bdf8e..53fd679e5 100644 --- a/src/Bundle/ChillActivityBundle/Entity/Activity.php +++ b/src/Bundle/ChillActivityBundle/Entity/Activity.php @@ -400,9 +400,11 @@ class Activity implements HasCenterInterface, HasScopeInterface /** * Add a person to the person list */ - public function addPerson(Person $person): self + public function addPerson(?Person $person): self { - $this->persons[] = $person; + if (null !== $person) { + $this->persons[] = $person; + } return $this; }