invalid foreach

This commit is contained in:
friendica 2013-01-06 14:00:34 -08:00
parent 431c402719
commit 6256c4e48e

View File

@ -383,10 +383,12 @@ function fb_get_friends_sync_full($uid, $access_token, $persons) {
if($s) { if($s) {
$results = json_decode($s); $results = json_decode($s);
logger('fb_get_friends: info: ' . print_r($results,true), LOGGER_DATA); logger('fb_get_friends: info: ' . print_r($results,true), LOGGER_DATA);
foreach ($results as $contact) { if(count($results)) {
if ($contact->code != 200) logger('fb_get_friends: not found: ' . print_r($contact,true), LOGGER_DEBUG); foreach ($results as $contact) {
else fb_get_friends_sync_parsecontact($uid, json_decode($contact->body)); 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));
}
}
} }
} }
} }