From 01328a1c15fb185dc93213280abf7098b97d3c4d Mon Sep 17 00:00:00 2001 From: Andrew Staves <32958622+Andrew-Staves-Activ@users.noreply.github.com> Date: Mon, 23 May 2022 15:51:03 +0100 Subject: [PATCH] Prevent TypeError while constructing ConnectionException. Now handles \imap_errors() returning false. Addresses/avoids barbushin/php-imap#671 --- src/PhpImap/Imap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpImap/Imap.php b/src/PhpImap/Imap.php index 7bc0ebbc..655c1dc8 100644 --- a/src/PhpImap/Imap.php +++ b/src/PhpImap/Imap.php @@ -709,7 +709,7 @@ public static function open( $result = @\imap_open($mailbox, $username, $password, $options, $n_retries, $params); if (!$result) { - throw new ConnectionException(\imap_errors()); + throw new ConnectionException(\imap_errors() ?: []); } return $result;