diff --git a/apps/dav/lib/Files/RootCollection.php b/apps/dav/lib/Files/RootCollection.php index ea10195a835a..61d561122722 100644 --- a/apps/dav/lib/Files/RootCollection.php +++ b/apps/dav/lib/Files/RootCollection.php @@ -47,11 +47,13 @@ public function getChildForPrincipal(array $principalInfo) { // in the future this could be considered to be used for accessing shared files return new SimpleCollection($name); } - $view = \OC\Files\Filesystem::getView(); $home = new FilesHome($principalInfo); - $rootInfo = $view->getFileInfo(''); - $rootNode = new Directory($view, $rootInfo, $home); - $home->init($rootNode, $view, \OC::$server->getMountManager()); + $view = \OC\Files\Filesystem::getView(); + if ($view) { + $rootInfo = $view->getFileInfo(''); + $rootNode = new Directory($view, $rootInfo, $home); + $home->init($rootNode, $view, \OC::$server->getMountManager()); + } return $home; } diff --git a/changelog/unreleased/36401 b/changelog/unreleased/36401 new file mode 100644 index 000000000000..d5fafb77991d --- /dev/null +++ b/changelog/unreleased/36401 @@ -0,0 +1,5 @@ +Bugfix: handling null properly in dav files endpoint + + Only if the files system is properly setup FileHome can properly be initialized + +https://github.com/owncloud/core/pull/36401