Explorar o código

Safer updateCachedValues (#5158)

#fix https://github.com/FreshRSS/FreshRSS/issues/5156
Alexandre Alapetite %!s(int64=3) %!d(string=hai) anos
pai
achega
44f72889a5
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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);
 		}