From 1c468129afa2b2ec4a370a879f8eaffd22768baf Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 23 Feb 2022 18:29:08 +0100 Subject: adjust tests to new fs setup Signed-off-by: Robin Appelman --- apps/files_sharing/lib/External/Manager.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'apps/files_sharing/lib') diff --git a/apps/files_sharing/lib/External/Manager.php b/apps/files_sharing/lib/External/Manager.php index a48e2a63ae4..a8510321a5a 100644 --- a/apps/files_sharing/lib/External/Manager.php +++ b/apps/files_sharing/lib/External/Manager.php @@ -43,6 +43,7 @@ use OCP\EventDispatcher\IEventDispatcher; use OCP\Federation\ICloudFederationFactory; use OCP\Federation\ICloudFederationProviderManager; use OCP\Files; +use OCP\Files\NotFoundException; use OCP\Files\Storage\IStorageFactory; use OCP\Http\Client\IClientService; use OCP\IDBConnection; @@ -599,8 +600,9 @@ class Manager { } public function removeShare($mountPoint): bool { - $mountPointObj = $this->mountManager->find($mountPoint); - if ($mountPointObj === null) { + try { + $mountPointObj = $this->mountManager->find($mountPoint); + } catch (NotFoundException $e) { $this->logger->error('Mount point to remove share not found', ['mountPoint' => $mountPoint]); return false; } -- cgit v1.2.3 From 917c74e214094e321ff96e1aa067ae60d22e2c58 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 3 Mar 2022 17:15:02 +0100 Subject: type fixes Signed-off-by: Robin Appelman --- apps/files_sharing/lib/Updater.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'apps/files_sharing/lib') diff --git a/apps/files_sharing/lib/Updater.php b/apps/files_sharing/lib/Updater.php index 9ce114f495d..ad194dde016 100644 --- a/apps/files_sharing/lib/Updater.php +++ b/apps/files_sharing/lib/Updater.php @@ -26,6 +26,7 @@ */ namespace OCA\Files_Sharing; +use OC\Files\Mount\MountPoint; use OCP\Constants; use OCP\Share\IShare; @@ -105,6 +106,7 @@ class Updater { $mountManager = \OC\Files\Filesystem::getMountManager(); $mountedShares = $mountManager->findIn('/' . \OC_User::getUser() . '/files/' . $oldPath); foreach ($mountedShares as $mount) { + /** @var MountPoint $mount */ if ($mount->getStorage()->instanceOfStorage(ISharedStorage::class)) { $mountPoint = $mount->getMountPoint(); $target = str_replace($absOldPath, $absNewPath, $mountPoint); -- cgit v1.2.3