From: Raphaƫl Gertz Date: Wed, 21 Feb 2024 11:47:00 +0000 (+0100) Subject: Protect from infinite remove recursion X-Git-Tag: 0.3.0~70 X-Git-Url: https://git.rapsys.eu/airbundle/commitdiff_plain/6235f8f993d9a97f08d00ce578c86da020d7e978 Protect from infinite remove recursion --- diff --git a/Entity/Dance.php b/Entity/Dance.php index 59896cd..8d83062 100644 --- a/Entity/Dance.php +++ b/Entity/Dance.php @@ -225,6 +225,10 @@ class Dance { * @return bool */ public function removeUser(User $user): bool { + if (!$this->users->contains($user)) { + return true; + } + //Remove from owning side $user->removeSubscriber($this);