Skip to content
Snippets Groups Projects
Commit 1dc25b5d authored by David Siegfried's avatar David Siegfried Committed by Jan-Hendrik Willms
Browse files

prevent error, closes #3521

Closes #3521

Merge request studip/studip!2406
parent d1580726
No related branches found
No related tags found
No related merge requests found
...@@ -176,12 +176,15 @@ class CourseEvent extends CourseDate implements Event ...@@ -176,12 +176,15 @@ class CourseEvent extends CourseDate implements Event
/** /**
* Returns the name of the category. * 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) public function toStringCategories($as_array = false)
{ {
$category = ''; $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']; $category = $GLOBALS['TERMIN_TYP'][$this->getCategory()]['name'];
} }
return $as_array ? [$category] : $category; return $as_array ? [$category] : $category;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment