]> git.mxchange.org Git - friendica-addons.git/commitdiff
fix PHPStan error in phpmailer addon
authorArt4 <art4@wlabs.de>
Wed, 26 Feb 2025 15:21:19 +0000 (15:21 +0000)
committerArt4 <art4@wlabs.de>
Wed, 26 Feb 2025 15:21:19 +0000 (15:21 +0000)
phpmailer/phpmailer.php

index f4bb7753e120d7953eb115462886e0ba8d4a1077..10287a04a31351d15a53d1e8ae40c335ac682b77 100644 (file)
@@ -28,10 +28,14 @@ function phpmailer_load_config(ConfigFileManager $loader)
 }
 
 /**
- * @param IEmail $email
+ * @param null|IEmail $email
  */
-function phpmailer_emailer_send_prepare(IEmail &$email)
+function phpmailer_emailer_send_prepare(?IEmail &$email)
 {
+       if ($email === null) {
+               return;
+       }
+
        // Passing `true` enables exceptions
        $mailer = new PHPMailer(true);
        try {