Fix crash from empty category
This commit is contained in:
@@ -509,9 +509,12 @@ function todo_list(array $model = []) : string
|
||||
$te->set_block("DATALIST_AUTOFILLS", "");
|
||||
|
||||
foreach ($categories as $category_key => $category)
|
||||
{
|
||||
if (!empty($categories[$category_key]["list"]))
|
||||
{
|
||||
ksort($categories[$category_key]["list"]);
|
||||
}
|
||||
}
|
||||
|
||||
$category_autofills = array_unique($category_autofills);
|
||||
foreach ($category_autofills as $autofill)
|
||||
@@ -531,6 +534,11 @@ function todo_list(array $model = []) : string
|
||||
$titles = array();
|
||||
foreach ($categories as $category_key => $category)
|
||||
{
|
||||
if (empty($category["list"]))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$te->set_block("MAIN_CATEGORY_ITEMS", "");
|
||||
|
||||
foreach ($category["list"] as $date_key => $date)
|
||||
|
||||
Reference in New Issue
Block a user