diff --git a/lib/private/Files/Storage/Wrapper/Quota.php b/lib/private/Files/Storage/Wrapper/Quota.php index 11b992dbf9727..d41ff6ff0e958 100644 --- a/lib/private/Files/Storage/Wrapper/Quota.php +++ b/lib/private/Files/Storage/Wrapper/Quota.php @@ -229,7 +229,7 @@ public function writeStream(string $path, $stream, ?int $size = null): int { } if ($size !== null) { - if ($size < $free) { + if ($free < 0 || $size < $free) { return parent::writeStream($path, $stream, $size); } else { throw new NotEnoughSpaceException();