Skip to content

Commit 37fcd20

Browse files
committed
only push to friends if they have a URL
1 parent 48d8c30 commit 37fcd20

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

solid/lib/Controller/ProfileController.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,13 @@ private function getUserProfile($userId) {
274274
$addressBooks = $this->contactsManager->getUserAddressBooks();
275275
$friends = [];
276276
foreach($addressBooks as $k => $v) {
277-
$results = $addressBooks[$k]->search('', ['FN'], ['types' => true]);
278-
foreach($results as $found) {
279-
foreach($found['URL'] as $i => $obj) {
280-
array_push($friends, $obj['value']);
281-
}
277+
$results = $addressBooks[$k]->search('', ['FN'], ['types' => true]);
278+
foreach($results as $found) {
279+
if (isset($found['URL']) && is_array($found['URL'])) {
280+
foreach($found['URL'] as $i => $obj) {
281+
array_push($friends, $obj['value']);
282+
}
283+
}
282284
}
283285
}
284286
if ($user !== null) {

0 commit comments

Comments
 (0)