Skip to content

Commit

Permalink
One day I will learn
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Mar 14, 2022
1 parent f1f2e3e commit 330b80c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Monolog/Handler/SwiftMailerHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ protected function buildMessage(string $content, array $records): Swift_Message
}

if (!$message instanceof Swift_Message) {
throw new \InvalidArgumentException('Could not resolve message as instance of Swift_Message or a callable returning it' . Utils::getRecordMessageForException(reset($records)));
$record = reset($records);
throw new \InvalidArgumentException('Could not resolve message as instance of Swift_Message or a callable returning it' . ($record ? Utils::getRecordMessageForException($record) : ''));
}

if ($records) {
Expand Down

0 comments on commit 330b80c

Please sign in to comment.