From a473ffeba85328b5e08d646dd8d8850ff782928c Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Willms Date: Tue, 29 Oct 2024 16:05:46 +0000 Subject: prevent warning, fixes #4778 Closes #4778 Merge request studip/studip!3574 --- lib/models/BlubberThread.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/models/BlubberThread.php b/lib/models/BlubberThread.php index ee391f7..d1fe7c4 100644 --- a/lib/models/BlubberThread.php +++ b/lib/models/BlubberThread.php @@ -410,11 +410,11 @@ class BlubberThread extends SimpleORMap implements PrivacyObject return mb_substr($names, 0, 60); } - if($this['context_type'] === 'course') { + if ($this['context_type'] === 'course') { if ($this['content']) { return mb_substr((string) Course::find($this['context_id'])->name . ': ' . $this['content'], 0, 50) . ' ...'; } else { - return (string) Course::find($this['context_id'])->name; + return (string) (Course::find($this['context_id'])->name ?? _('unbekannt')); } } -- cgit v1.0