From: Michael Vogel Date: Thu, 5 Feb 2015 18:51:57 +0000 (+0100) Subject: app.net: Avaoid warnings if site is not reachable. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=adff04dca23b6a4d2890e2d858282bbe5f88605a;p=friendica-addons.git app.net: Avaoid warnings if site is not reachable. --- diff --git a/appnet/appnet.php b/appnet/appnet.php index c327bd7d..f0bdce6e 100644 --- a/appnet/appnet.php +++ b/appnet/appnet.php @@ -690,8 +690,12 @@ function appnet_fetchstream($a, $uid) { } catch (AppDotNetException $e) { logger("appnet_fetchstream: Error fetching stream for user ".$uid." ".appnet_error($e->getMessage())); + return; } + if (!is_array($stream)) + $stream = array(); + $stream = array_reverse($stream); foreach ($stream AS $post) { $postarray = appnet_createpost($a, $uid, $post, $me, $user, $ownid, true); @@ -744,8 +748,12 @@ function appnet_fetchstream($a, $uid) { } catch (AppDotNetException $e) { logger("appnet_fetchstream: Error fetching mentions for user ".$uid." ".appnet_error($e->getMessage())); + return; } + if (!is_array($mentions)) + $mentions = array(); + $mentions = array_reverse($mentions); foreach ($mentions AS $post) { $postarray = appnet_createpost($a, $uid, $post, $me, $user, $ownid, false);