Skip to content
Snippets Groups Projects
Commit 707bbb23 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 dccfbe7b
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
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