Fix null array index bug for PHP 7.4 (#2780)

Fix https://github.com/FreshRSS/FreshRSS/issues/2775
Especially for PHP 7.4+ "Array-style access of non-arrays"
https://php.net/migration74.incompatible
This commit is contained in:
Alexandre Alapetite
2020-01-20 19:28:13 +01:00
committed by GitHub
parent cd5ebcee05
commit e537bcc397

View File

@@ -372,7 +372,7 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo implements FreshRSS_Searchable
$feedsDao = array();
$feedDao = FreshRSS_Factory::createFeedDAO();
foreach ($listDAO as $line) {
if ($previousLine['c_id'] != null && $line['c_id'] !== $previousLine['c_id']) {
if (!empty($previousLine['c_id']) && $line['c_id'] !== $previousLine['c_id']) {
// End of the current category, we add it to the $list
$cat = new FreshRSS_Category(
$previousLine['c_name'],