Skip to content

Commit

Permalink
Merge pull request #100 from dododedodonl/fix-undefined-array-key
Browse files Browse the repository at this point in the history
Add default
  • Loading branch information
freekmurze authored Sep 14, 2023
2 parents 42ae056 + 1789c1e commit 00b744e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PreviewMailTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ protected function getPreviewFilePath(SentMessage $message): string
$to = '';

/** @var \Symfony\Component\Mime\Address $toAddress */
if ($toAddress = $message->getOriginalMessage()->getTo()[0]) {
if ($toAddress = ($message->getOriginalMessage()->getTo()[0] ?? null)) {
$to = str_replace(['@', '.'], ['_at_', '_'], $toAddress->getAddress()) . '_';
}

Expand Down

0 comments on commit 00b744e

Please sign in to comment.