]> git.mxchange.org Git - friendica-addons.git/commitdiff
app.net: Avaoid warnings if site is not reachable.
authorMichael Vogel <icarus@dabo.de>
Thu, 5 Feb 2015 18:51:57 +0000 (19:51 +0100)
committerMichael Vogel <icarus@dabo.de>
Thu, 5 Feb 2015 18:51:57 +0000 (19:51 +0100)
appnet/appnet.php

index c327bd7d59b997441c7b2da536c6128fae12b2db..f0bdce6ecc44d6639cfee386f87df14f860e940d 100644 (file)
@@ -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);