aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/dav/lib/Connector/Sabre/ObjectTree.php2
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php2
2 files changed, 3 insertions, 1 deletions
diff --git a/apps/dav/lib/Connector/Sabre/ObjectTree.php b/apps/dav/lib/Connector/Sabre/ObjectTree.php
index d05f0857ec9..25db1d5028c 100644
--- a/apps/dav/lib/Connector/Sabre/ObjectTree.php
+++ b/apps/dav/lib/Connector/Sabre/ObjectTree.php
@@ -156,7 +156,7 @@ class ObjectTree extends CachingTree {
try {
$info = $this->fileView->getFileInfo($path);
- if ($info->getStorage()->instanceOfStorage(FailedStorage::class)) {
+ if ($info instanceof \OCP\Files\FileInfo && $info->getStorage()->instanceOfStorage(FailedStorage::class)) {
throw new StorageNotAvailableException();
}
} catch (StorageNotAvailableException $e) {
diff --git a/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php b/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php
index a8fbcb39a85..cd575e4ff3c 100644
--- a/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php
@@ -174,6 +174,8 @@ class ObjectTreeTest extends \Test\TestCase {
$fileInfo->expects($this->once())
->method('getName')
->will($this->returnValue($outputFileName));
+ $fileInfo->method('getStorage')
+ ->willReturn($this->createMock(\OC\Files\Storage\Common::class));
$view->expects($this->once())
->method('getFileInfo')