aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/lib/Controller/ApiController.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-04-19 16:39:57 +0200
committerJoas Schilling <coding@schilljs.com>2023-04-19 16:39:57 +0200
commit8b31d8204fcc51e55cde846446a183c2fcb58fcf (patch)
treed37d9cc10da0a24efa428b7dc541c122e9d66d04 /apps/files/lib/Controller/ApiController.php
parentfd473f89e8ec31b0d050cc293f698390b2e7e689 (diff)
downloadnextcloud-server-8b31d8204fcc51e55cde846446a183c2fcb58fcf.tar.gz
nextcloud-server-8b31d8204fcc51e55cde846446a183c2fcb58fcf.zip
fix(files): Don't throw an error when guests access the controller
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/files/lib/Controller/ApiController.php')
-rw-r--r--apps/files/lib/Controller/ApiController.php18
1 files changed, 4 insertions, 14 deletions
diff --git a/apps/files/lib/Controller/ApiController.php b/apps/files/lib/Controller/ApiController.php
index 9b5d12baa96..fd0f3bdf261 100644
--- a/apps/files/lib/Controller/ApiController.php
+++ b/apps/files/lib/Controller/ApiController.php
@@ -70,28 +70,18 @@ class ApiController extends Controller {
private IPreview $previewManager;
private IUserSession $userSession;
private IConfig $config;
- private Folder $userFolder;
+ private ?Folder $userFolder;
private UserConfig $userConfig;
private ViewConfig $viewConfig;
- /**
- * @param string $appName
- * @param IRequest $request
- * @param IUserSession $userSession
- * @param TagService $tagService
- * @param IPreview $previewManager
- * @param IManager $shareManager
- * @param IConfig $config
- * @param Folder $userFolder
- */
- public function __construct($appName,
+ public function __construct(string $appName,
IRequest $request,
IUserSession $userSession,
TagService $tagService,
IPreview $previewManager,
IManager $shareManager,
IConfig $config,
- Folder $userFolder,
+ ?Folder $userFolder,
UserConfig $userConfig,
ViewConfig $viewConfig) {
parent::__construct($appName, $request);
@@ -406,7 +396,7 @@ class ApiController extends Controller {
$node = $this->userFolder->get($folderpath);
return $node->getType();
}
-
+
/**
* @NoAdminRequired
* @NoCSRFRequired