diff options
author | fox <[email protected]> | 2021-12-14 15:51:36 +0300 |
---|---|---|
committer | fox <[email protected]> | 2021-12-14 15:51:36 +0300 |
commit | 3ef9bb5b58a19028c4755e1f5f14c38dd3a09eb7 (patch) | |
tree | 19a9116fe6f9742a23253ac06369cf9cc1fc1e49 /classes | |
parent | 471f97ca8234f0cc2c818bf954ee1bb16720a37b (diff) | |
parent | 0726a9d820855f96dccf873e6279f74479800efb (diff) |
Merge pull request 'Handle the admin user not having any entries in 'Feeds::_get_global_unread'.' (#60) from wn/tt-rss:bugfix/get-global-unread-admin-null into master
Reviewed-on: https://git.tt-rss.org/fox/tt-rss/pulls/60
Diffstat (limited to 'classes')
-rwxr-xr-x | classes/feeds.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/classes/feeds.php b/classes/feeds.php index a9afb70f2..62fd6a5b3 100755 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -955,7 +955,8 @@ class Feeds extends Handler_Protected { $sth->execute([$owner_uid, $feed]); $row = $sth->fetch(); - return $row["count"]; + // Handle 'SUM()' returning null if there are no results + return $row["count"] ?? 0; } else if ($n_feed == -1) { $match_part = "marked = true"; @@ -1359,7 +1360,8 @@ class Feeds extends Handler_Protected { $sth->execute([$user_id]); $row = $sth->fetch(); - return $row["count"]; + // Handle 'SUM()' returning null if there are no articles/results (e.g. admin user with no feeds) + return $row["count"] ?? 0; } static function _get_cat_title(int $cat_id): string { |