summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/connector/sabre/filesplugin.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-12-09 17:31:14 +0100
committerMorris Jobke <hey@morrisjobke.de>2015-12-10 16:17:44 +0100
commit174f7599e575e350bc6177fd315a7657c37323f7 (patch)
treee3c86b951b5f8495066d46313f03a2abe9689ffa /apps/dav/lib/connector/sabre/filesplugin.php
parent7094ed05adfa435a53d7d6ce0c3b6d32760f5111 (diff)
downloadnextcloud-server-174f7599e575e350bc6177fd315a7657c37323f7.tar.gz
nextcloud-server-174f7599e575e350bc6177fd315a7657c37323f7.zip
Catch exception when querying direct download link
Diffstat (limited to 'apps/dav/lib/connector/sabre/filesplugin.php')
-rw-r--r--apps/dav/lib/connector/sabre/filesplugin.php11
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;
});