summaryrefslogtreecommitdiffstats
path: root/lib/private/Group/Manager.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Group/Manager.php')
-rw-r--r--lib/private/Group/Manager.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/private/Group/Manager.php b/lib/private/Group/Manager.php
index 944598a8296..8b18abd5e95 100644
--- a/lib/private/Group/Manager.php
+++ b/lib/private/Group/Manager.php
@@ -223,7 +223,12 @@ class Manager extends PublicEmitter implements IGroupManager {
foreach ($this->backends as $backend) {
$groupIds = $backend->getGroups($search, $limit, $offset);
foreach ($groupIds as $groupId) {
- $groups[$groupId] = $this->get($groupId);
+ $aGroup = $this->get($groupId);
+ if (!is_null($aGroup)) {
+ $groups[$groupId] = $aGroup;
+ } else {
+ \OC::$server->getLogger()->debug('Group "' . $groupId . '" was returned by search but not found through direct access', array('app' => 'core'));
+ }
}
if (!is_null($limit) and $limit <= 0) {
return array_values($groups);
@@ -256,7 +261,12 @@ class Manager extends PublicEmitter implements IGroupManager {
$groupIds = $backend->getUserGroups($uid);
if (is_array($groupIds)) {
foreach ($groupIds as $groupId) {
- $groups[$groupId] = $this->get($groupId);
+ $aGroup = $this->get($groupId);
+ if (!is_null($aGroup)) {
+ $groups[$groupId] = $aGroup;
+ } else {
+ \OC::$server->getLogger()->debug('User "' . $uid . '" belongs to deleted group: "' . $groupId . '"', array('app' => 'core'));
+ }
}
}
}