diff --git a/lib/models/CourseEvent.class.php b/lib/models/CourseEvent.class.php index 2d564b5dd4f2af438dac998c8544de92fee6c172..e33532dc7dadd51ea87b4f59a51fdb6c7a6485af 100644 --- a/lib/models/CourseEvent.class.php +++ b/lib/models/CourseEvent.class.php @@ -140,12 +140,15 @@ class CourseEvent extends CourseDate implements Event /** * Returns the name of the category. * - * @return string the name of the category + * @return array|string the name of the category */ public function toStringCategories($as_array = false) { $category = ''; - if ($this->havePermission(Event::PERMISSION_READABLE)) { + if ( + $this->havePermission(Event::PERMISSION_READABLE) + && !empty($GLOBALS['TERMIN_TYP'][$this->getCategory()]) + ) { $category = $GLOBALS['TERMIN_TYP'][$this->getCategory()]['name']; } return $as_array ? [$category] : $category;