]> git.mxchange.org Git - friendica.git/commitdiff
Fixed E_NOTICE when no valid result has been returned. (#5457)
authorRoland Häder <Quix0r@users.noreply.github.com>
Sun, 22 Jul 2018 22:05:10 +0000 (00:05 +0200)
committerHypolite Petovan <mrpetovan@eml.cc>
Sun, 22 Jul 2018 22:05:10 +0000 (18:05 -0400)
mod/notes.php

index f83195ff1ccdb1e1a16f75375d8df20bd1b27ad9..3bc9e0fadebbd1c16bc98a32dcb4147d9711f777 100644 (file)
@@ -68,7 +68,10 @@ function notes_content(App $a, $update = false)
                'limit' => [$a->pager['start'], $a->pager['itemspage']]];
        $r = Item::selectForUser(local_user(), ['id'], $condition, $params);
 
+       $count = 0;
+
        if (DBM::is_result($r)) {
+               $count = count($r);
                $parents_arr = [];
 
                while ($rr = Item::fetch($r)) {
@@ -78,12 +81,14 @@ function notes_content(App $a, $update = false)
 
                $condition = ['uid' => local_user(), 'parent' => $parents_arr];
                $result = Item::selectForUser(local_user(), [], $condition);
+
                if (DBM::is_result($result)) {
                        $items = conv_sort(Item::inArray($result), 'commented');
                        $o .= conversation($a, $items, 'notes', $update);
                }
        }
 
-       $o .= alt_pager($a, count($r));
+       $o .= alt_pager($a, $count);
+
        return $o;
 }