]> git.mxchange.org Git - friendica.git/commitdiff
Ensure IEMail::getMessage returns a string
authorHypolite Petovan <hypolite@mrpetovan.com>
Sun, 20 Nov 2022 00:08:44 +0000 (19:08 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sun, 20 Nov 2022 00:15:47 +0000 (19:15 -0500)
src/Object/EMail/IEmail.php
src/Object/Email.php

index f1e66a224fa088efa141438127c39fc01f87203b..9fd1fe3da6309401391a7a74cb81b4c9845c7972 100644 (file)
@@ -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
index 57eb0c17e9b155099521b81d23007de4016f720c..4d5a11715cace161baed3287072d48c27c8e914f 100644 (file)
@@ -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 ?? '';
                }
        }