diff --git a/apps/files_sharing/lib/mountmanager.php b/apps/files_sharing/lib/mountmanager.php index 69c32aee845c..c4c34e9523e7 100644 --- a/apps/files_sharing/lib/mountmanager.php +++ b/apps/files_sharing/lib/mountmanager.php @@ -45,6 +45,9 @@ function __construct(Manager $mountManager, Loader $storageLoader, IUserManager public function setupMounts($options) { /** @var \OCP\IUser $user */ $user = $options['user_object']; + if (!$user) { + return; + } $shares = \OCP\Share::getItemsSharedWithUser('file', $user->getUID()); foreach ($shares as $share) { $owner = $this->userManager->get($share['uid_owner']);