Commit 6dcaac7e authored by Roeland Jago Douma's avatar Roeland Jago Douma
Browse files

Return empty list if group does not have subadmins

Instead of throwing an error just return an empty list. Since that is
actually what it is.

Fixes #19789
parent 5ec64c4f
......@@ -176,14 +176,8 @@ class Groups{
foreach ($subadmins as $user) {
$uids[] = $user->getUID();
}
$subadmins = $uids;
// Go
if(!$subadmins) {
return new OC_OCS_Result(null, 102, 'Unknown error occured');
} else {
return new OC_OCS_Result($subadmins);
}
return new OC_OCS_Result($uids);
}
}
......@@ -308,9 +308,8 @@ class GroupsTest extends \Test\TestCase {
]);
$this->assertInstanceOf('OC_OCS_Result', $result);
$this->assertFalse($result->succeeded());
$this->assertEquals(102, $result->getStatusCode());
$this->assertEquals('Unknown error occured', $result->getMeta()['message']);
$this->assertTrue($result->succeeded());
$this->assertEquals([], $result->getData());
}
public function testAddGroupEmptyGroup() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment