From 56457505af5446c6c0d9e8ef39d47f19b79185e6 Mon Sep 17 00:00:00 2001 From: Felix Nieuwenhuizen Date: Sat, 2 Mar 2019 13:55:11 +0100 Subject: set availableSpace to 0 if userFolder not found Signed-off-by: Felix Nieuwenhuizen --- apps/files_versions/lib/Storage.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'apps/files_versions/lib') 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; -- cgit v1.2.3