Skip to content

Commit

Permalink
use lazy user in UserMountCache
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <robin@icewind.nl>
  • Loading branch information
icewind1991 committed Aug 17, 2022
1 parent a2d1457 commit 5fc5cf1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/private/Files/Config/UserMountCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 5fc5cf1

Please sign in to comment.