Skip to content

Commit a67ebfa

Browse files
committed
Minor - fix PHP warning
1 parent 84c2d48 commit a67ebfa

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

main/inc/lib/AnnouncementManager.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,10 @@ public static function parseContent(
7474
) {
7575
$readerInfo = api_get_user_info($userId, false, false, true, true, false, true);
7676
$courseInfo = api_get_course_info($courseCode);
77-
$teacherList = CourseManager::getTeacherListFromCourseCodeToString($courseInfo['code']);
78-
77+
$teacherList = '';
78+
if ($courseInfo) {
79+
$teacherList = CourseManager::getTeacherListFromCourseCodeToString($courseInfo['code']);
80+
}
7981
$generalCoachName = '';
8082
$generalCoachEmail = '';
8183
$coaches = '';
@@ -105,7 +107,7 @@ public static function parseContent(
105107
$data['user_official_code'] = $readerInfo['official_code'];
106108
}
107109

108-
$data['course_title'] = $courseInfo['name'];
110+
$data['course_title'] = $courseInfo['name'] ?? '';
109111
$courseLink = api_get_course_url($courseCode, $sessionId);
110112
$data['course_link'] = Display::url($courseLink, $courseLink);
111113
$data['teachers'] = $teacherList;

0 commit comments

Comments
 (0)