From 5fc5cf1d46ee33ca21a982aa75f356b7b37d4a23 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 17 Aug 2022 14:19:23 +0200 Subject: [PATCH] use lazy user in UserMountCache Signed-off-by: Robin Appelman --- lib/private/Files/Config/UserMountCache.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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;