diff --git a/lib/models/BlubberThread.php b/lib/models/BlubberThread.php index 590a600e4a884dd7d51563c49e6a6b1acfb456b7..6753cfb8bedb8f221b8de6a42970df067f3e8936 100644 --- a/lib/models/BlubberThread.php +++ b/lib/models/BlubberThread.php @@ -428,11 +428,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')); } }