Fix case with no user
This commit is contained in:
parent
ae3d0d96fe
commit
28d070730d
|
@ -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];
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue