diff --git a/lib/Service/CirclesService.php b/lib/Service/CirclesService.php index 129329d76..2ecf9b098 100644 --- a/lib/Service/CirclesService.php +++ b/lib/Service/CirclesService.php @@ -564,11 +564,11 @@ public function checkThatCircleIsNotFull(Circle $circle) { if ($limit === -1) { return; } - if ($limit === 0) { + if ($limit === 0 || $limit === '' || $limit === null) { $limit = $this->configService->getAppValue(ConfigService::CIRCLES_MEMBERS_LIMIT); } - if (sizeof($members) >= $limit) { + if (sizeof($members) >= $limit) { throw new MembersLimitException( 'This circle already reach its limit on the number of members' ); diff --git a/tests/unit/lib/Api/CirclesTest.php b/tests/unit/lib/Api/CirclesTest.php index b47165a97..c543c43fe 100644 --- a/tests/unit/lib/Api/CirclesTest.php +++ b/tests/unit/lib/Api/CirclesTest.php @@ -702,6 +702,7 @@ public function testJoinCircleAndLeave() { $member->getCircleId() ] ); + } catch (MemberDoesNotExistException $e) { } catch (Exception $e) { throw $e; }