diff --git a/lib/Service/CirclesService.php b/lib/Service/CirclesService.php index 129329d7..2ecf9b09 100644 --- a/lib/Service/CirclesService.php +++ b/lib/Service/CirclesService.php @@ -564,11 +564,11 @@ class CirclesService { 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 b47165a9..c543c43f 100644 --- a/tests/unit/lib/Api/CirclesTest.php +++ b/tests/unit/lib/Api/CirclesTest.php @@ -702,6 +702,7 @@ class CirclesTest extends \PHPUnit_Framework_TestCase { $member->getCircleId() ] ); + } catch (MemberDoesNotExistException $e) { } catch (Exception $e) { throw $e; }