Skip to content

Commit f56a7f8

Browse files
committed
Fixed TypeError
1 parent f1ff5ca commit f56a7f8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Jyxo/Mail/Parser.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,10 @@ public function getHeaders(?string $pid = null): array
210210
$headerInfo = imap_rfc822_parse_headers($rawHeaders);
211211
}
212212

213+
if ($headerInfo === false) {
214+
return [];
215+
}
216+
213217
// Adds a header that the IMAP extension does not support
214218
if (preg_match("~Disposition-Notification-To:(.+?)(?=\r?\n(?:\\S|\r?\n))~is", $rawHeaders, $matches)) {
215219
$addressList = imap_rfc822_parse_adrlist($matches[1], '');

0 commit comments

Comments
 (0)