diff options
Diffstat (limited to 'apps/dav/lib/connector/sabre')
-rw-r--r-- | apps/dav/lib/connector/sabre/filesplugin.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/dav/lib/connector/sabre/filesplugin.php b/apps/dav/lib/connector/sabre/filesplugin.php index 1c78e9dc845..aa756281745 100644 --- a/apps/dav/lib/connector/sabre/filesplugin.php +++ b/apps/dav/lib/connector/sabre/filesplugin.php @@ -31,6 +31,7 @@ use \Sabre\DAV\PropFind; use \Sabre\DAV\PropPatch; use \Sabre\HTTP\RequestInterface; use \Sabre\HTTP\ResponseInterface; +use OCP\Files\StorageNotAvailableException; class FilesPlugin extends \Sabre\DAV\ServerPlugin { @@ -225,9 +226,13 @@ class FilesPlugin extends \Sabre\DAV\ServerPlugin { if ($node instanceof \OCA\DAV\Connector\Sabre\File) { $propFind->handle(self::DOWNLOADURL_PROPERTYNAME, function() use ($node) { /** @var $node \OCA\DAV\Connector\Sabre\File */ - $directDownloadUrl = $node->getDirectDownload(); - if (isset($directDownloadUrl['url'])) { - return $directDownloadUrl['url']; + try { + $directDownloadUrl = $node->getDirectDownload(); + if (isset($directDownloadUrl['url'])) { + return $directDownloadUrl['url']; + } + } catch (StorageNotAvailableException $e) { + return false; } return false; }); |