diff --git a/trigger/categories/lib.php b/trigger/categories/lib.php index 97ed716f..9d0ca44c 100644 --- a/trigger/categories/lib.php +++ b/trigger/categories/lib.php @@ -76,6 +76,9 @@ public function get_course_recordset_where($triggerid) { $allcategories = []; foreach ($categories as $category) { array_push($allcategories, $category); + if (!isset($categoryobjects[$category])) { + continue; + } $children = $categoryobjects[$category]->get_all_children_ids(); $allcategories = array_merge($allcategories, $children); }