summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/dav/lib/connector/sabre/objecttree.php2
-rw-r--r--tests/lib/files/storage/storage.php6
2 files changed, 7 insertions, 1 deletions
diff --git a/apps/dav/lib/connector/sabre/objecttree.php b/apps/dav/lib/connector/sabre/objecttree.php
index a1796136c4e..505a42d4746 100644
--- a/apps/dav/lib/connector/sabre/objecttree.php
+++ b/apps/dav/lib/connector/sabre/objecttree.php
@@ -136,7 +136,7 @@ class ObjectTree extends \Sabre\DAV\Tree {
$mount = $this->fileView->getMount($path);
$storage = $mount->getStorage();
$internalPath = $mount->getInternalPath($absPath);
- if ($storage) {
+ if ($storage && $storage->file_exists($internalPath)) {
/**
* @var \OC\Files\Storage\Storage $storage
*/
diff --git a/tests/lib/files/storage/storage.php b/tests/lib/files/storage/storage.php
index 42bd491df5c..f3d265df2de 100644
--- a/tests/lib/files/storage/storage.php
+++ b/tests/lib/files/storage/storage.php
@@ -608,4 +608,10 @@ abstract class Storage extends \Test\TestCase {
$stat = $this->instance->stat('foo.txt');
$this->assertEquals(6, $stat['size']);
}
+
+ public function testPartFile() {
+ $this->instance->file_put_contents('bar.txt.part', 'bar');
+ $this->instance->rename('bar.txt.part', 'bar.txt');
+ $this->assertEquals('bar', $this->instance->file_get_contents('bar.txt'));
+ }
}