summaryrefslogtreecommitdiffstats
path: root/lib/private/files/storage/wrapper/quota.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/files/storage/wrapper/quota.php')
-rw-r--r--lib/private/files/storage/wrapper/quota.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/private/files/storage/wrapper/quota.php b/lib/private/files/storage/wrapper/quota.php
index 32ceba8b196..a878b2c5cf6 100644
--- a/lib/private/files/storage/wrapper/quota.php
+++ b/lib/private/files/storage/wrapper/quota.php
@@ -69,7 +69,14 @@ class Quota extends Wrapper {
return \OC\Files\SPACE_NOT_COMPUTED;
} else {
$free = $this->storage->free_space($path);
- return min($free, (max($this->quota - $used, 0)));
+ $quotaFree = max($this->quota - $used, 0);
+ // if free space is known
+ if ($free >= 0) {
+ $free = min($free, $quotaFree);
+ } else {
+ $free = $quotaFree;
+ }
+ return $free;
}
}
}