From 6235f8f993d9a97f08d00ce578c86da020d7e978 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Wed, 21 Feb 2024 12:47:00 +0100 Subject: [PATCH] Protect from infinite remove recursion --- Entity/Dance.php | 4 ++++ 1 file changed, 4 insertions(+) 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); -- 2.41.1