summaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Config
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2016-11-24 11:44:18 +0100
committerRobin Appelman <robin@icewind.nl>2016-11-24 11:44:18 +0100
commitce2f9493a72672826bd95f5d7b39210e5c020d06 (patch)
treee3d89357d90b332fe91ecf27ebae3812f7bb551e /lib/private/Files/Config
parentf4cf125a4a9e43478dc4def3308cdd2f72c91321 (diff)
downloadnextcloud-server-ce2f9493a72672826bd95f5d7b39210e5c020d06.tar.gz
nextcloud-server-ce2f9493a72672826bd95f5d7b39210e5c020d06.zip
filter out oc_mounts results from non existing users
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Files/Config')
-rw-r--r--lib/private/Files/Config/UserMountCache.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/private/Files/Config/UserMountCache.php b/lib/private/Files/Config/UserMountCache.php
index e9e142d0d4b..c9a701d24b6 100644
--- a/lib/private/Files/Config/UserMountCache.php
+++ b/lib/private/Files/Config/UserMountCache.php
@@ -188,6 +188,9 @@ class UserMountCache implements IUserMountCache {
private function dbRowToMountInfo(array $row) {
$user = $this->userManager->get($row['user_id']);
+ if (is_null($user)) {
+ return null;
+ }
return new CachedMountInfo($user, (int)$row['storage_id'], (int)$row['root_id'], $row['mount_point'], $row['mount_id'], isset($row['path'])? $row['path']:'');
}
@@ -205,7 +208,7 @@ class UserMountCache implements IUserMountCache {
$rows = $query->execute()->fetchAll();
- $this->mountsForUsers[$user->getUID()] = array_map([$this, 'dbRowToMountInfo'], $rows);
+ $this->mountsForUsers[$user->getUID()] = array_filter(array_map([$this, 'dbRowToMountInfo'], $rows));
}
return $this->mountsForUsers[$user->getUID()];
}
@@ -223,7 +226,7 @@ class UserMountCache implements IUserMountCache {
$rows = $query->execute()->fetchAll();
- return array_map([$this, 'dbRowToMountInfo'], $rows);
+ return array_filter(array_map([$this, 'dbRowToMountInfo'], $rows));
}
/**
@@ -239,7 +242,7 @@ class UserMountCache implements IUserMountCache {
$rows = $query->execute()->fetchAll();
- return array_map([$this, 'dbRowToMountInfo'], $rows);
+ return array_filter(array_map([$this, 'dbRowToMountInfo'], $rows));
}
/**