]> Raphaël G. Git Repositories - airbundle/commitdiff
Protect from infinite remove recursion
authorRaphaël Gertz <git@rapsys.eu>
Wed, 21 Feb 2024 11:47:00 +0000 (12:47 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Wed, 21 Feb 2024 11:47:00 +0000 (12:47 +0100)
Entity/Dance.php

index 59896cdad505495196db859127b24a081cda5c7b..8d83062901439c9a72b02a88da5c5f7da43f1b7b 100644 (file)
@@ -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);