]> git.mxchange.org Git - friendica-addons.git/commitdiff
invalid foreach
authorfriendica <info@friendica.com>
Sun, 6 Jan 2013 22:00:34 +0000 (14:00 -0800)
committerfriendica <info@friendica.com>
Sun, 6 Jan 2013 22:00:34 +0000 (14:00 -0800)
facebook/facebook.php

index f977bef90192f469097bc26d3cb729aab93447f9..4c1c0a14142dcc34e5768ceb103454fc0d5f2f2c 100644 (file)
@@ -383,10 +383,12 @@ function fb_get_friends_sync_full($uid, $access_token, $persons) {
         if($s) {
             $results = json_decode($s);
             logger('fb_get_friends: info: ' . print_r($results,true), LOGGER_DATA);
-            foreach ($results as $contact) {
-                if ($contact->code != 200) logger('fb_get_friends: not found: ' . print_r($contact,true), LOGGER_DEBUG);
-                else fb_get_friends_sync_parsecontact($uid, json_decode($contact->body));
-            }
+                       if(count($results)) {
+                   foreach ($results as $contact) {
+                   if ($contact->code != 200) logger('fb_get_friends: not found: ' . print_r($contact,true), LOGGER_DEBUG);
+                       else fb_get_friends_sync_parsecontact($uid, json_decode($contact->body));
+               }
+                       }
         }
     }
 }