From a147038c2eb4685c101a207289d0ec71f6a0efec Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 19 Nov 2022 19:08:44 -0500 Subject: [PATCH] Ensure IEMail::getMessage returns a string --- src/Object/EMail/IEmail.php | 2 +- src/Object/Email.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Object/EMail/IEmail.php b/src/Object/EMail/IEmail.php index f1e66a224f..9fd1fe3da6 100644 --- a/src/Object/EMail/IEmail.php +++ b/src/Object/EMail/IEmail.php @@ -80,7 +80,7 @@ interface IEmail extends JsonSerializable * * @return string */ - function getMessage(bool $plain = false); + function getMessage(bool $plain = false): string; /** * Gets the additional mail header array diff --git a/src/Object/Email.php b/src/Object/Email.php index 57eb0c17e9..4d5a11715c 100644 --- a/src/Object/Email.php +++ b/src/Object/Email.php @@ -110,12 +110,12 @@ class Email implements IEmail /** * {@inheritDoc} */ - public function getMessage(bool $plain = false) + public function getMessage(bool $plain = false): string { if ($plain) { return $this->msgText; } else { - return $this->msgHtml; + return $this->msgHtml ?? ''; } } -- 2.39.5