Fix free space problems

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
pull/37062/head
Git'Fellow 2023-03-07 00:13:57 +07:00 committed by GitHub
parent 394ad988c7
commit 9ac065fb92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

@ -418,7 +418,7 @@ class Local extends \OC\Files\Storage\Common {
// disk_free_space doesn't work on files
$sourcePath = dirname($sourcePath);
}
$space = function_exists('disk_free_space') ? disk_free_space($sourcePath) : false;
$space = is_dir($sourcePath) ? disk_free_space($sourcePath) : false;
if ($space === false || is_null($space)) {
return \OCP\Files\FileInfo::SPACE_UNKNOWN;
}