diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php index 8aa7d66ba3..d2d9420292 100644 --- a/apps/dav/lib/Connector/Sabre/File.php +++ b/apps/dav/lib/Connector/Sabre/File.php @@ -169,9 +169,12 @@ class File extends Node implements IFile { if ($partStorage->instanceOfStorage(Storage\IWriteStreamStorage::class)) { if (!is_resource($data)) { - $data = fopen('php://temp', 'r+'); - fwrite($data, 'foobar'); - rewind($data); + $tmpData = fopen('php://temp', 'r+'); + if ($data !== null) { + fwrite($tmpData, $data); + rewind($tmpData); + } + $data = $tmpData; } $isEOF = false;