From 4eb5cfb5c3f6f794617dda0d9b09317b5158add2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Str=C3=B8m?= Date: Wed, 21 Dec 2016 14:46:23 +0100 Subject: [PATCH] Only check CC if actually set --- src/MailHog.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MailHog.php b/src/MailHog.php index 59c71eb..ac8002f 100644 --- a/src/MailHog.php +++ b/src/MailHog.php @@ -148,7 +148,7 @@ public function accessInboxFor($address) { if(!isset($email->Content->Headers->Bcc)) { - if(strpos($email->Content->Headers->To[0], $addressPlusDelimiters) || array_search($email->Content->Headers->Cc[0], $addressPlusDelimiters)) + if(strpos($email->Content->Headers->To[0], $addressPlusDelimiters) || (isset($email->Content->Headers->Cc) && array_search($email->Content->Headers->Cc[0], $addressPlusDelimiters))) { array_push($inbox, $email); }