]> git.mxchange.org Git - friendica-addons.git/commitdiff
array_reverse in line 1233 sometimes got no array as 1st arg
authorTobias Diekershoff <tobias.diekershoff@gmx.net>
Wed, 2 Oct 2013 06:38:56 +0000 (08:38 +0200)
committerTobias Diekershoff <tobias.diekershoff@gmx.net>
Wed, 2 Oct 2013 06:38:56 +0000 (08:38 +0200)
pumpio/pumpio.php

index f697b227c7d16d3d3f8d0856c78059879abe1a78..7300b3888aa96c117b0a7ed63b624d807169b135 100755 (executable)
@@ -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);
 }