diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-06-24 17:38:34 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-06-24 17:38:34 +0200 |
commit | 5f59393b30f9132b48d828387838847cea6026a5 (patch) | |
tree | 946dfbbabb478aaa0ab399db153a155eeb8f5394 /apps | |
parent | 004280e407beca36bfc64640f9ebeb42e40a4cd7 (diff) | |
parent | 4f2f8a6f288a523ec5f6deadd0bdfa04ec72cb9c (diff) | |
download | nextcloud-server-5f59393b30f9132b48d828387838847cea6026a5.tar.gz nextcloud-server-5f59393b30f9132b48d828387838847cea6026a5.zip |
Merge pull request #17110 from owncloud/share-error-handling
[sharing] handle shares of users that aren't available anymore
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/lib/mountprovider.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/mountprovider.php b/apps/files_sharing/lib/mountprovider.php index 94fb473883d..c5d3643f28d 100644 --- a/apps/files_sharing/lib/mountprovider.php +++ b/apps/files_sharing/lib/mountprovider.php @@ -9,6 +9,7 @@ namespace OCA\Files_Sharing; use OC\Files\Filesystem; +use OC\User\NoUserException; use OCA\Files_Sharing\Propagation\PropagationManager; use OCP\Files\Config\IMountProvider; use OCP\Files\Storage\IStorageFactory; @@ -50,8 +51,13 @@ class MountProvider implements IMountProvider { $shares = array_filter($shares, function ($share) { return $share['permissions'] > 0; }); - return array_map(function ($share) use ($user, $storageFactory) { - Filesystem::initMountPoints($share['uid_owner']); + $shares = array_map(function ($share) use ($user, $storageFactory) { + try { + Filesystem::initMountPoints($share['uid_owner']); + } catch(NoUserException $e) { + \OC::$server->getLogger()->warning('The user \'' . $share['uid_owner'] . '\' of share with ID \'' . $share['id'] . '\' can\'t be retrieved.', array('app' => 'files_sharing')); + return null; + } // for updating etags for the share owner when we make changes to this share. $ownerPropagator = $this->propagationManager->getChangePropagator($share['uid_owner']); @@ -68,5 +74,7 @@ class MountProvider implements IMountProvider { $storageFactory ); }, $shares); + // array_filter removes the null values from the array + return array_filter($shares); } } |