]> source.dussan.org Git - nextcloud-server.git/commitdiff
Check return of disk_free_space before returning it
authorJoas Schilling <nickvergessen@gmx.de>
Thu, 27 Nov 2014 10:42:49 +0000 (11:42 +0100)
committerJoas Schilling <nickvergessen@gmx.de>
Thu, 27 Nov 2014 13:59:08 +0000 (14:59 +0100)
Local changes copied from ed8359737199a8a6640986e00df80d971aa6e1d7
and 25370fcb8235d2129cab0f8a5843c4784b3673d0

lib/private/files/storage/mappedlocal.php

index 6745dad77f28d2c3eadf02ae137901e74bf34b58..e1d234dda1353ce1588797a9695d478279db548e 100644 (file)
@@ -292,7 +292,11 @@ class MappedLocal extends \OC\Files\Storage\Common {
        }
 
        public function free_space($path) {
-               return @disk_free_space($this->getSourcePath($path));
+               $space = @disk_free_space($this->getSourcePath($path));
+               if ($space === false || is_null($space)) {
+                       return \OCP\Files\FileInfo::SPACE_UNKNOWN;
+               }
+               return $space;
        }
 
        public function search($query) {