Skip to content

Commit

Permalink
fix getName() when transport is null
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Aug 6, 2019
1 parent 233562f commit ee4192e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/Symfony/Component/Mailer/Transport/AbstractTransport.php
Expand Up @@ -39,8 +39,6 @@ public function __construct(EventDispatcherInterface $dispatcher = null, LoggerI
$this->logger = $logger ?: new NullLogger();
}

abstract public function getName(): string;

/**
* Sets the maximum number of messages to send per second (0 to disable).
*/
Expand Down
6 changes: 5 additions & 1 deletion src/Symfony/Component/Mailer/Transport/SendmailTransport.php
Expand Up @@ -75,7 +75,11 @@ public function send(RawMessage $message, SmtpEnvelope $envelope = null): ?SentM

public function getName(): string
{
return $this->transport->getName();
if ($this->transport) {
return $this->transport->getName();
}

return 'smtp://sendmail';
}

protected function doSend(SentMessage $message): void
Expand Down

0 comments on commit ee4192e

Please sign in to comment.