aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2025-02-21 07:00:28 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2025-02-21 07:00:28 +0000
commite861c76ffa4c12c8b3a9dd79585bf4297c989c89 (patch)
tree98be2fc9e368ec4dc0d21c872f8f952bd280695a
parent4511272cd09af9506e9c65cc253918712142aabb (diff)
check if event is actually in any calendars, fixes #5266
Closes #5266 Merge request studip/studip!3949
-rw-r--r--lib/models/ConsultationEvent.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/models/ConsultationEvent.php b/lib/models/ConsultationEvent.php
index fe8a405..4194f6a 100644
--- a/lib/models/ConsultationEvent.php
+++ b/lib/models/ConsultationEvent.php
@@ -32,6 +32,10 @@ class ConsultationEvent extends SimpleORMap
$config['registered_callbacks'] = [
'before_delete' => [
function (ConsultationEvent $event) {
+ if (!isset($event->event->calendars)) {
+ return;
+ }
+
// Suppress all mails from calendar for users that do not
// want to receive emails about consultation bookings
$event->event->calendars->each(function (CalendarDateAssignment $assignment) {