aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2016-05-03 14:05:51 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2016-06-14 11:34:41 +0200
commit28d070730d9de5aec690f152a95dbf1da123d2ee (patch)
treec8ae03e57a90f2f0f2ddae7b6d872a4ea98e53ac /lib
parentae3d0d96fe7e273f6dfae3a5ca4754b5da4353cc (diff)
downloadnextcloud-server-28d070730d9de5aec690f152a95dbf1da123d2ee.tar.gz
nextcloud-server-28d070730d9de5aec690f152a95dbf1da123d2ee.zip
Fix case with no user
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Share20/Manager.php4
-rw-r--r--lib/public/Util.php7
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php
index 2b1c7d828f1..e2730f4d5fb 100644
--- a/lib/private/Share20/Manager.php
+++ b/lib/private/Share20/Manager.php
@@ -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];
}
diff --git a/lib/public/Util.php b/lib/public/Util.php
index 86f84565218..687f4e78f69 100644
--- a/lib/public/Util.php
+++ b/lib/public/Util.php
@@ -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);
}
/**