]> git.mxchange.org Git - friendica.git/commitdiff
Add error handling for missing contacts
authorHypolite Petovan <mrpetovan@gmail.com>
Wed, 12 Apr 2017 01:18:34 +0000 (21:18 -0400)
committerHypolite Petovan <mrpetovan@gmail.com>
Wed, 12 Apr 2017 01:18:34 +0000 (21:18 -0400)
include/acl_selectors.php

index 4036886c49938e016e7bcad936420a6cbbd0623d..0e30ee06e80c6c4c486788f2c90c8e386ccec77a 100644 (file)
@@ -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
+                                       );
+                               }
                        }
                }