From: Tobias Diekershoff Date: Wed, 2 Oct 2013 06:38:56 +0000 (+0200) Subject: array_reverse in line 1233 sometimes got no array as 1st arg X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4fa6a3015fdea3c4bb7b9143ee716139a970eb5b;p=friendica-addons.git array_reverse in line 1233 sometimes got no array as 1st arg --- diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index f697b227..7300b388 100755 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -1230,13 +1230,16 @@ function pumpio_fetchinbox(&$a, $uid) { $url .= '?since='.urlencode($last_id); $success = $client->CallAPI($url, 'GET', array(), array('FailOnAccessError'=>true), $user); - $posts = array_reverse($user->items); - if (count($posts)) - foreach ($posts as $post) { - $last_id = $post->id; - pumpio_dopost($a, $client, $uid, $self, $post, $own_id); - } + if ($user->items) { + $posts = array_reverse($user->items); + + if (count($posts)) + foreach ($posts as $post) { + $last_id = $post->id; + pumpio_dopost($a, $client, $uid, $self, $post, $own_id); + } + } set_pconfig($uid,'pumpio','last_id', $last_id); }