fixing stuff

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
This commit is contained in:
Maxence Lange 2018-08-01 10:36:05 -01:00
parent bd517f19e1
commit a3779358d8
2 changed files with 3 additions and 2 deletions

View file

@ -564,11 +564,11 @@ class CirclesService {
if ($limit === -1) { if ($limit === -1) {
return; return;
} }
if ($limit === 0) { if ($limit === 0 || $limit === '' || $limit === null) {
$limit = $this->configService->getAppValue(ConfigService::CIRCLES_MEMBERS_LIMIT); $limit = $this->configService->getAppValue(ConfigService::CIRCLES_MEMBERS_LIMIT);
} }
if (sizeof($members) >= $limit) { if (sizeof($members) >= $limit) {
throw new MembersLimitException( throw new MembersLimitException(
'This circle already reach its limit on the number of members' 'This circle already reach its limit on the number of members'
); );

View file

@ -702,6 +702,7 @@ class CirclesTest extends \PHPUnit_Framework_TestCase {
$member->getCircleId() $member->getCircleId()
] ]
); );
} catch (MemberDoesNotExistException $e) {
} catch (Exception $e) { } catch (Exception $e) {
throw $e; throw $e;
} }