diff --git a/lib/private/Files/Config/UserMountCache.php b/lib/private/Files/Config/UserMountCache.php index 3540b56374219..2abb69d354bb6 100644 --- a/lib/private/Files/Config/UserMountCache.php +++ b/lib/private/Files/Config/UserMountCache.php @@ -28,6 +28,7 @@ */ namespace OC\Files\Config; +use OC\User\LazyUser; use OCP\Cache\CappedMemoryCache; use OCA\Files_Sharing\SharedMount; use OCP\DB\QueryBuilder\IQueryBuilder; @@ -204,10 +205,14 @@ private function removeFromCache(ICachedMountInfo $mount) { } private function dbRowToMountInfo(array $row) { - $user = $this->userManager->get($row['user_id']); - if (is_null($user)) { + $userid = $row['user_id']; + + // check that the user exits + if ($this->userManager->getDisplayName($userid) === null) { return null; } + $user = new LazyUser($userid, $this->userManager); + $mount_id = $row['mount_id']; if (!is_null($mount_id)) { $mount_id = (int)$mount_id;