summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Service/SocialApiService.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Service/SocialApiService.php b/lib/Service/SocialApiService.php
index 9a27a93d..cc32cbcc 100644
--- a/lib/Service/SocialApiService.php
+++ b/lib/Service/SocialApiService.php
@@ -183,12 +183,14 @@ class SocialApiService {
}
// search contact in that addressbook, get social data
- $contact = $addressBook->search($contactId, ['UID'], ['types' => true])[0];
+ $contacts = $addressBook->search($contactId, ['UID'], ['types' => true]);
- if (!isset($contact)) {
+ if (!isset($contacts[0])) {
return new JSONResponse([], Http::STATUS_PRECONDITION_FAILED);
}
+ $contact = $contacts[0];
+
if ($network) {
$allConnectors = [$this->socialProvider->getSocialConnector($network)];
}