Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Do not unintentionally create blank Sender header.
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelGooden committed Jun 10, 2016
1 parent 23af4a3 commit a6e9193
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,10 @@ public function setSender($emailOrAddress, $name = null)
*/
public function getSender()
{
$headers = $this->getHeaders();
if (!$headers->has('sender')) {
return null;
}
$header = $this->getHeaderByName('sender', __NAMESPACE__ . '\Header\Sender');
return $header->getAddress();
}
Expand Down

0 comments on commit a6e9193

Please sign in to comment.