Explorar el Código

Safer updateCachedValues (#5158)

#fix https://github.com/FreshRSS/FreshRSS/issues/5156
Alexandre Alapetite hace 3 años
padre
commit
44f72889a5
Se han modificado 1 ficheros con 1 adiciones y 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);
 		}