From: Vincent Petry Date: Mon, 27 Oct 2014 15:27:12 +0000 (+0100) Subject: Properly catch 503 storage not available in getQuotaInfo X-Git-Tag: v7.0.3RC2~9 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3ba1441c2db2622a02d4081b07b45e0f5702ce30;p=nextcloud-server.git Properly catch 503 storage not available in getQuotaInfo When doing a PROPFIND on the root and one of the mount points is not available, the returned quota attributes will now be zero. This fix prevents the expected exception to make the whole call fail. Backport of 21d825ed6c11425d36a143f8ed63f1e3852d0aeb from master --- diff --git a/lib/private/connector/sabre/directory.php b/lib/private/connector/sabre/directory.php index 8815a261db8..00807224c24 100644 --- a/lib/private/connector/sabre/directory.php +++ b/lib/private/connector/sabre/directory.php @@ -205,13 +205,17 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node * @return array */ public function getQuotaInfo() { - $path = \OC\Files\Filesystem::getView()->getRelativePath($this->info->getPath()); - $storageInfo = OC_Helper::getStorageInfo($path); - return array( - $storageInfo['used'], - $storageInfo['free'] - ); - + try { + $path = \OC\Files\Filesystem::getView()->getRelativePath($this->info->getPath()); + $storageInfo = OC_Helper::getStorageInfo($path); + return array( + $storageInfo['used'], + $storageInfo['free'] + ); + } + catch (\OCP\Files\StorageNotAvailableException $e) { + return array(0, 0); + } } /**