From c5427da76d6d01fe9967204d3c019b493ceae6b9 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 27 Nov 2014 11:42:49 +0100 Subject: [PATCH] Check return of disk_free_space before returning it Local changes copied from ed8359737199a8a6640986e00df80d971aa6e1d7 and 25370fcb8235d2129cab0f8a5843c4784b3673d0 --- lib/private/files/storage/mappedlocal.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/private/files/storage/mappedlocal.php b/lib/private/files/storage/mappedlocal.php index 6745dad77f2..e1d234dda13 100644 --- a/lib/private/files/storage/mappedlocal.php +++ b/lib/private/files/storage/mappedlocal.php @@ -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) { -- 2.39.5