Browse Source

Fix case with no user

tags/v9.1.0RC1
Roeland Jago Douma 8 years ago
parent
commit
28d070730d
No account linked to committer's email address
2 changed files with 10 additions and 1 deletions
  1. 4
    0
      lib/private/Share20/Manager.php
  2. 6
    1
      lib/public/Util.php

+ 4
- 0
lib/private/Share20/Manager.php 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];
}

+ 6
- 1
lib/public/Util.php 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);
}

/**

Loading…
Cancel
Save