From 6b8ad57399e46eef6db713861f74a6fbddf587e8 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 11 Apr 2017 21:18:34 -0400 Subject: [PATCH] Add error handling for missing contacts --- include/acl_selectors.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/include/acl_selectors.php b/include/acl_selectors.php index 4036886c49..0e30ee06e8 100644 --- a/include/acl_selectors.php +++ b/include/acl_selectors.php @@ -637,16 +637,18 @@ function acl_lookup(App $a, $out_type = 'json') { foreach ($r as $row) { $contact = get_contact_details_by_url($row['author-link'], 0); - $unknown_contacts[] = array( - 'type' => 'cu', - 'photo' => proxy_url($contact['micro'], false, PROXY_SIZE_MICRO), - 'name' => htmlentities($contact['name']), - 'id' => intval($contact['id']), - 'network' => $contact['network'], - 'link' => $contact['url'], - 'nick' => $contact['nick'], - 'forum' => false - ); + if (count($contact) > 0) { + $unknown_contacts[] = array( + 'type' => 'cu', + 'photo' => proxy_url($contact['micro'], false, PROXY_SIZE_MICRO), + 'name' => htmlentities($contact['name']), + 'id' => intval($contact['id']), + 'network' => $contact['network'], + 'link' => $contact['url'], + 'nick' => $contact['nick'], + 'forum' => false + ); + } } }