Fix case with no user

This commit is contained in:
Roeland Jago Douma 2016-05-03 14:05:51 +02:00 committed by Roeland Jago Douma
parent ae3d0d96fe
commit 28d070730d
No known key found for this signature in database
GPG Key ID: 1E152838F164D13B
2 changed files with 10 additions and 1 deletions

View File

@ -1212,6 +1212,10 @@ class Manager implements IManager {
* @return bool
*/
public function sharingDisabledForUser($userId) {
if ($userId === null) {
return false;
}
if (isset($this->sharingDisabledForUsersCache[$userId])) {
return $this->sharingDisabledForUsersCache[$userId];
}

View File

@ -181,7 +181,12 @@ class Util {
self::$shareManager = \OC::$server->getShareManager();
}
return self::$shareManager->sharingDisabledForUser(\OC::$server->getUserSession()->getUser()->getUID());
$user = \OC::$server->getUserSession()->getUser();
if ($user !== null) {
$user = $user->getUID();
}
return self::$shareManager->sharingDisabledForUser($user);
}
/**