Don't call getUID on null when the app is loaded for a guest

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2018-07-23 16:38:33 +02:00
parent 6b440cc365
commit 3cac54b955
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
1 changed files with 5 additions and 1 deletions

View File

@ -96,7 +96,11 @@ if ($config->getAppValue('core', 'shareapi_enabled', 'yes') === 'yes') {
]);
// 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',