From: Roland Häder Date: Sun, 22 Jul 2018 22:05:10 +0000 (+0200) Subject: Fixed E_NOTICE when no valid result has been returned. (#5457) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ad857b43149624998c09f9acc25e61c716041951;p=friendica.git Fixed E_NOTICE when no valid result has been returned. (#5457) --- diff --git a/mod/notes.php b/mod/notes.php index f83195ff1c..3bc9e0fade 100644 --- a/mod/notes.php +++ b/mod/notes.php @@ -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; }