diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index 6a5da08a8a488..886eb5dcfa9df 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -292,7 +292,7 @@ private function getDisplayNameFromAddressBook(string $query, string $property): $result = \OC::$server->getContactsManager()->search($query, [$property]); foreach ($result as $r) { foreach ($r[$property] as $value) { - if ($value === $query) { + if ($value === $query && $r['FN']) { return $r['FN']; } }