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

index 984e8d86449593b160334a94560d2ddfd34211c3..613e46281c3664f841ddbc86f8790c8bfb50f966 100644 (file)
@@ -444,6 +444,10 @@ class Location {
         * @return bool
         */
        public function removeUser(User $user): bool {
+               if (!$this->users->contains($user)) {
+                       return true;
+               }
+
                //Remove from owning side
                $user->removeSubscriber($this);