diff options
author | Robin Appelman <robin@icewind.nl> | 2018-07-17 17:28:02 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2018-07-18 14:42:39 +0200 |
commit | d4a51447d1b6858f2e8dae12cb2d38c2e2fa5e6b (patch) | |
tree | 9938ac20c394f96200c3bf6ca17601d65c503cdb /apps/dav/lib/Connector/Sabre/Node.php | |
parent | ad9b458c7437e20be7d5a93ce383effe354bfeba (diff) | |
download | nextcloud-server-d4a51447d1b6858f2e8dae12cb2d38c2e2fa5e6b.tar.gz nextcloud-server-d4a51447d1b6858f2e8dae12cb2d38c2e2fa5e6b.zip |
Fix getting ocs share permissions if a storage is not available
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/dav/lib/Connector/Sabre/Node.php')
-rw-r--r-- | apps/dav/lib/Connector/Sabre/Node.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/apps/dav/lib/Connector/Sabre/Node.php b/apps/dav/lib/Connector/Sabre/Node.php index 9e78d21a39d..38d0ff57fb2 100644 --- a/apps/dav/lib/Connector/Sabre/Node.php +++ b/apps/dav/lib/Connector/Sabre/Node.php @@ -38,6 +38,7 @@ use OC\Files\Mount\MoveableMount; use OC\Files\View; use OCA\DAV\Connector\Sabre\Exception\InvalidPath; use OCP\Files\FileInfo; +use OCP\Files\StorageNotAvailableException; use OCP\Share\Exceptions\ShareNotFound; use OCP\Share\IManager; @@ -250,15 +251,17 @@ abstract class Node implements \Sabre\DAV\INode { } } - $storage = $this->info->getStorage(); - - $path = $this->info->getInternalPath(); + try { + $storage = $this->info->getStorage(); + } catch (StorageNotAvailableException $e) { + $storage = null; + } - if ($storage->instanceOfStorage('\OCA\Files_Sharing\SharedStorage')) { + if ($storage && $storage->instanceOfStorage('\OCA\Files_Sharing\SharedStorage')) { /** @var \OCA\Files_Sharing\SharedStorage $storage */ $permissions = (int)$storage->getShare()->getPermissions(); } else { - $permissions = $storage->getPermissions($path); + $permissions = $this->info->getPermissions(); } /* |