Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2022-03-08 17:50:25 +0300
committerGitHub <noreply@github.com>2022-03-08 17:50:25 +0300
commite8872f01ae850bcbf66220beba44463f68e3d673 (patch)
tree9b2b1d01992d26368ff456af0440d0a2965308a6 /apps/files_sharing/lib
parent23e8ae15aaea30359a927492155de13c97b311ce (diff)
parent917c74e214094e321ff96e1aa067ae60d22e2c58 (diff)
Merge pull request #31431 from nextcloud/fs-setup-manager
Unify/cleanup filesystem setup
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/External/Manager.php6
-rw-r--r--apps/files_sharing/lib/Updater.php2
2 files changed, 6 insertions, 2 deletions
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;
}
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);