diff --git a/apps/files_sharing/appinfo/app.php b/apps/files_sharing/appinfo/app.php index 567b1a16bacae..13705718a04a8 100644 --- a/apps/files_sharing/appinfo/app.php +++ b/apps/files_sharing/appinfo/app.php @@ -96,7 +96,11 @@ function() { ]); // show_Quick_Access stored as string - $defaultExpandedState = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_sharing_menu', '0') === '1'; + $user = $userSession->getUser(); + $defaultExpandedState = true; + if ($user instanceof \OCP\IUser) { + $defaultExpandedState = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_sharing_menu', '0') === '1'; + } \OCA\Files\App::getNavigationManager()->add([ 'id' => 'shareoverview',