Merge pull request #19980 from owncloud/fix-deleted-ldap-user-sharing

handle NoUserException in sharing code
This commit is contained in:
Thomas Müller 2015-10-22 17:53:15 +02:00
commit 7b5db9085d
1 changed files with 7 additions and 1 deletions

View File

@ -32,6 +32,7 @@
namespace OC\Files\Cache;
use OC\User\NoUserException;
use OCP\Share_Backend_Collection;
/**
@ -64,7 +65,12 @@ class Shared_Cache extends Cache {
}
$source = \OC_Share_Backend_File::getSource($target, $this->storage->getShare());
if (isset($source['path']) && isset($source['fileOwner'])) {
\OC\Files\Filesystem::initMountPoints($source['fileOwner']);
try {
\OC\Files\Filesystem::initMountPoints($source['fileOwner']);
} catch(NoUserException $e) {
\OC::$server->getLogger()->logException($e, ['app' => 'files_sharing']);
return false;
}
$mounts = \OC\Files\Filesystem::getMountByNumericId($source['storage']);
if (is_array($mounts) and !empty($mounts)) {
$fullPath = $mounts[0]->getMountPoint() . $source['path'];