Merge pull request #10296 from nextcloud/bug/noid/dont_fail_on_unkown_user

Don't fail contacts menu on unkown user
This commit is contained in:
Joas Schilling 2018-07-20 03:08:32 +02:00 committed by GitHub
commit 6b440cc365
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -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;