Fixed exception related to strict types.

This commit is contained in:
Jan Böhmer 2020-03-15 14:55:37 +01:00
parent 0fd677d2fd
commit 9dc5d325da

View file

@ -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;
}
}
/**