From b0d92db0cde16a51cb4733dfd068d4c50ec006d4 Mon Sep 17 00:00:00 2001
From: David Siegfried <david.siegfried@uni-vechta.de>
Date: Fri, 17 Nov 2023 08:39:44 +0000
Subject: [PATCH] prevent php8-warnings, closes #3476

Closes #3476

Merge request studip/studip!2372
---
 app/controllers/calendar/schedule.php | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/app/controllers/calendar/schedule.php b/app/controllers/calendar/schedule.php
index 52c6f36c9e8..6fb51c401e2 100644
--- a/app/controllers/calendar/schedule.php
+++ b/app/controllers/calendar/schedule.php
@@ -243,7 +243,11 @@ class Calendar_ScheduleController extends AuthenticatedController
                 $this->render_template('calendar/schedule/_entry_course');
             } else if ($id) {
                 $entry_columns = CalendarScheduleModel::getScheduleEntries($GLOBALS['user']->id, 0, 0, $id);
-                $entries = array_pop($entry_columns)->getEntries();
+                $entries = [];
+                $entry_columns = array_pop($entry_columns);
+                if ($entry_columns) {
+                    $entries = $entry_columns->getEntries();
+                }
                 $this->show_entry = array_pop($entries);
                 $this->render_template('calendar/schedule/_entry_schedule');
             }
-- 
GitLab