Browse Source

Safer updateCachedValues (#5158)

#fix https://github.com/FreshRSS/FreshRSS/issues/5156
Alexandre Alapetite 3 years ago
parent
commit
44f72889a5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/Models/FeedDAO.php

+ 1 - 1
app/Models/FeedDAO.php

@@ -434,7 +434,7 @@ SQL;
 			. '`cache_nbUnreads`=(SELECT COUNT(e2.id) FROM `_entry` e2 WHERE e2.id_feed=`_feed`.id AND e2.is_read=0)'
 			. ($id != 0 ? ' WHERE id=:id' : '');
 		$stm = $this->pdo->prepare($sql);
-		if ($id != 0) {
+		if ($stm && $id != 0) {
 			$stm->bindParam(':id', $id, PDO::PARAM_INT);
 		}