]> source.dussan.org Git - nextcloud-server.git/commitdiff
Properly catch 503 storage not available in getQuotaInfo
authorVincent Petry <pvince81@owncloud.com>
Mon, 27 Oct 2014 15:27:12 +0000 (16:27 +0100)
committerVincent Petry <pvince81@owncloud.com>
Tue, 28 Oct 2014 08:53:24 +0000 (09:53 +0100)
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

lib/private/connector/sabre/directory.php

index 8815a261db8fb17efe90f9cfe47c2e58c5ca992d..00807224c249ed8005731da9bc77d106bc0108f7 100644 (file)
@@ -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);
+               }
        }
 
        /**