summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-02-25 20:53:59 +0100
committerVincent Petry <pvince81@owncloud.com>2015-02-25 20:53:59 +0100
commit64c333c44bfb74daf4d3bf29ef4a373e4fe52ad6 (patch)
tree1ca870b194c183c8a54b8935b7b45aa041653d83 /lib/private
parente8c3e3315415699386273ce6ecf1d3137f94c0b9 (diff)
parent9ee37169a6615e06c397e3b623ca55805aebcea3 (diff)
downloadnextcloud-server-64c333c44bfb74daf4d3bf29ef4a373e4fe52ad6.tar.gz
nextcloud-server-64c333c44bfb74daf4d3bf29ef4a373e4fe52ad6.zip
Merge pull request #14508 from owncloud/tagmanager-nouser
Return null when requesting tags for null user
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/tagmanager.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/private/tagmanager.php b/lib/private/tagmanager.php
index 9bc461f25eb..1c7ace11469 100644
--- a/lib/private/tagmanager.php
+++ b/lib/private/tagmanager.php
@@ -65,6 +65,11 @@ class TagManager implements \OCP\ITagManager {
*/
public function load($type, $defaultTags = array(), $includeShared = false, $userId = null) {
if (is_null($userId)) {
+ $user = $this->userSession->getUser();
+ if ($user === null) {
+ // nothing we can do without a user
+ return null;
+ }
$userId = $this->userSession->getUser()->getUId();
}
return new Tags($this->mapper, $userId, $type, $defaultTags, $includeShared);