Handle case when no group mentioned in testing group exists

This commit is contained in:
Pranav Kant 2016-11-20 19:59:51 +05:30
parent ceef0b3688
commit 7599628bf3

View File

@ -165,7 +165,7 @@ class DocumentController extends Controller {
]);
foreach ($testgroups as $testgroup) {
$test = \OC::$server->getGroupManager()->get($testgroup);
if (sizeof($test->searchUsers($user)) > 0) {
if ($test !== null && sizeof($test->searchUsers($user)) > 0) {
\OC::$server->getLogger()->debug('User {user} found in {group}', [
'app' => $this->appName,
'user' => $user,