From 9dc5d325da4cd38338355fa55918ad0c64d743e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sun, 15 Mar 2020 14:55:37 +0100 Subject: [PATCH] Fixed exception related to strict types. --- src/Services/LogSystem/EventCommentHelper.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Services/LogSystem/EventCommentHelper.php b/src/Services/LogSystem/EventCommentHelper.php index 09e6da1c..04d8ce0a 100644 --- a/src/Services/LogSystem/EventCommentHelper.php +++ b/src/Services/LogSystem/EventCommentHelper.php @@ -42,7 +42,11 @@ class EventCommentHelper public function setMessage(?string $message): void { //Restrict the length of the string - $this->message = mb_strimwidth($message, 0, self::MAX_MESSAGE_LENGTH, '...'); + if ($message) { + $this->message = mb_strimwidth($message, 0, self::MAX_MESSAGE_LENGTH, '...'); + } else { + $this->message = null; + } } /**