summaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Storage/Common.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Files/Storage/Common.php')
-rw-r--r--lib/private/Files/Storage/Common.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/private/Files/Storage/Common.php b/lib/private/Files/Storage/Common.php
index 6324050b472..72fe3a79792 100644
--- a/lib/private/Files/Storage/Common.php
+++ b/lib/private/Files/Storage/Common.php
@@ -821,6 +821,9 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage {
*/
public function writeStream(string $path, $stream, int $size = null): int {
$target = $this->fopen($path, 'w');
+ if (!$target) {
+ return 0;
+ }
list($count, $result) = \OC_Helper::streamCopy($stream, $target);
fclose($stream);
fclose($target);