mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-10-27 13:38:54 -04:00
Avoid exception in searchById (#4822)
https://github.com/FreshRSS/FreshRSS/issues/4820 Not a root-cause fix though (cannot reproduce so far)
This commit is contained in:
1 parent
5897487f2f
commit
2c0f3fad2d
1 file changed
+9
-9
@@ -228,16 +228,16 @@ SQL;
|
||||
public function searchById($id) {
|
||||
$sql = 'SELECT * FROM `_category` WHERE id=:id';
|
||||
$stm = $this->pdo->prepare($sql);
|
||||
$stm->bindParam(':id', $id, PDO::PARAM_INT);
|
||||
$stm->execute();
|
||||
$res = $stm->fetchAll(PDO::FETCH_ASSOC);
|
||||
$cat = self::daoToCategory($res);
|
||||
|
||||
if (isset($cat[0])) {
|
||||
return $cat[0];
|
||||
} else {
|
||||
return null;
|
||||
if ($stm &&
|
||||
$stm->bindParam(':id', $id, PDO::PARAM_INT) &&
|
||||
$stm->execute()) {
|
||||
$res = $stm->fetchAll(PDO::FETCH_ASSOC);
|
||||
$cat = self::daoToCategory($res);
|
||||
if (isset($cat[0])) {
|
||||
return $cat[0];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/** @return FreshRSS_Category|null|false */
|
||||
|
||||
Reference in new issue
Block a user