summaryrefslogtreecommitdiffstats
path: root/apps/files_versions/lib
diff options
context:
space:
mode:
authorFelix Nieuwenhuizen <felix@tdlrali.com>2019-03-02 13:55:11 +0100
committerFelix Nieuwenhuizen <felix@tdlrali.com>2019-03-02 13:55:11 +0100
commit56457505af5446c6c0d9e8ef39d47f19b79185e6 (patch)
treecbb2e9fb3655f7575ec1455a733df7a303d84ac0 /apps/files_versions/lib
parent0f43d1dfaa2799f10c070a6d5f825fb3430bea4d (diff)
downloadnextcloud-server-56457505af5446c6c0d9e8ef39d47f19b79185e6.tar.gz
nextcloud-server-56457505af5446c6c0d9e8ef39d47f19b79185e6.zip
set availableSpace to 0 if userFolder not found
Signed-off-by: Felix Nieuwenhuizen <felix@tdlrali.com>
Diffstat (limited to 'apps/files_versions/lib')
-rw-r--r--apps/files_versions/lib/Storage.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php
index 4ed3977435b..c09633be3c1 100644
--- a/apps/files_versions/lib/Storage.php
+++ b/apps/files_versions/lib/Storage.php
@@ -752,13 +752,14 @@ class Storage {
if ($softQuota) {
$userFolder = \OC::$server->getUserFolder($uid);
if(is_null($userFolder)) {
- return 0;
- }
- $free = $quota - $userFolder->getSize(false); // remaining free space for user
- if ($free > 0) {
- $availableSpace = ($free * self::DEFAULTMAXSIZE / 100) - $versionsSize; // how much space can be used for versions
+ $availableSpace = 0;
} else {
- $availableSpace = $free - $versionsSize;
+ $free = $quota - $userFolder->getSize(false); // remaining free space for user
+ if ($free > 0) {
+ $availableSpace = ($free * self::DEFAULTMAXSIZE / 100) - $versionsSize; // how much space can be used for versions
+ } else {
+ $availableSpace = $free - $versionsSize;
+ }
}
} else {
$availableSpace = $quota;