diff --git a/lib/private/Files/SetupManager.php b/lib/private/Files/SetupManager.php index 393a6a7de0fc6..63d972cc0cd82 100644 --- a/lib/private/Files/SetupManager.php +++ b/lib/private/Files/SetupManager.php @@ -434,8 +434,10 @@ public function setupRoot(): void { * @param string $path * @return IUser|null */ - private function getUserForPath(string $path) { - if (str_starts_with($path, '/__groupfolders')) { + private function getUserForPath(string $path): ?IUser { + if ($path === '' || $path === '/') { + return null; + } elseif (str_starts_with($path, '/__groupfolders')) { return null; } elseif (substr_count($path, '/') < 2) { if ($user = $this->userSession->getUser()) {