summaryrefslogtreecommitdiffstats
path: root/lib/private/Contacts/ContactsMenu
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-07-19 11:39:28 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2018-07-19 11:39:28 +0200
commit16bfbb78ca80bbebf9883f0963f4a2c58d677538 (patch)
tree91fbacbff0ecbc40ad96f28472b7ac8237bec2bd /lib/private/Contacts/ContactsMenu
parentad9b458c7437e20be7d5a93ce383effe354bfeba (diff)
downloadnextcloud-server-16bfbb78ca80bbebf9883f0963f4a2c58d677538.tar.gz
nextcloud-server-16bfbb78ca80bbebf9883f0963f4a2c58d677538.zip
Don't fail contacts menu on unkown user
If for some reason the system addressbook holds a user that is no longer accessible from the usermanager (so it got somehow out of sync) we should not fail hard but rather just ignore the entry. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/Contacts/ContactsMenu')
-rw-r--r--lib/private/Contacts/ContactsMenu/ContactsStore.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/Contacts/ContactsMenu/ContactsStore.php b/lib/private/Contacts/ContactsMenu/ContactsStore.php
index bfce7deafa4..05ef9cca53a 100644
--- a/lib/private/Contacts/ContactsMenu/ContactsStore.php
+++ b/lib/private/Contacts/ContactsMenu/ContactsStore.php
@@ -155,7 +155,13 @@ class ContactsStore implements IContactsStore {
}
if ($ownGroupsOnly && $entry->getProperty('isLocalSystemBook') === true) {
- $contactGroups = $this->groupManager->getUserGroupIds($this->userManager->get($entry->getProperty('UID')));
+ $uid = $this->userManager->get($entry->getProperty('UID'));
+
+ if ($uid === NULL) {
+ return false;
+ }
+
+ $contactGroups = $this->groupManager->getUserGroupIds($uid);
if (count(array_intersect($contactGroups, $selfGroups)) === 0) {
// no groups in common, so shouldn't see the contact
return false;