summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/Files/RootCollection.php
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2018-05-24 14:17:53 +0200
committerRobin Appelman <robin@icewind.nl>2018-05-24 14:17:53 +0200
commit51724a35a4c6cec0fbb758b64239a13fc9b3381a (patch)
treeb133dbb00f31689404cc19398c61958b3ad7a486 /apps/dav/lib/Files/RootCollection.php
parentfd4a7bf72a0c8a69325b1d63e6983021ac6651f8 (diff)
downloadnextcloud-server-51724a35a4c6cec0fbb758b64239a13fc9b3381a.tar.gz
nextcloud-server-51724a35a4c6cec0fbb758b64239a13fc9b3381a.zip
use getUserFolder instead of getFileInfo when constructing FilesHome
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/dav/lib/Files/RootCollection.php')
-rw-r--r--apps/dav/lib/Files/RootCollection.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/dav/lib/Files/RootCollection.php b/apps/dav/lib/Files/RootCollection.php
index 59b6690a026..f5544693f2c 100644
--- a/apps/dav/lib/Files/RootCollection.php
+++ b/apps/dav/lib/Files/RootCollection.php
@@ -23,6 +23,7 @@
*/
namespace OCA\DAV\Files;
+use OCP\Files\FileInfo;
use Sabre\DAV\INode;
use Sabre\DAVACL\AbstractPrincipalCollection;
use Sabre\DAV\SimpleCollection;
@@ -48,7 +49,11 @@ class RootCollection extends AbstractPrincipalCollection {
// in the future this could be considered to be used for accessing shared files
return new SimpleCollection($name);
}
- return new FilesHome($principalInfo);
+ $userFolder = \OC::$server->getUserFolder();
+ if (!($userFolder instanceof FileInfo)) {
+ throw new \Exception('Home does not exist');
+ }
+ return new FilesHome($principalInfo, $userFolder);
}
function getName() {