Skip to content

Commit 107b5de

Browse files
committed
Fix when replyTo email address is not set
1 parent de6ca85 commit 107b5de

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/Messaging/Mail/MailBag.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,17 +182,25 @@ public function getFromName(): string
182182
/**
183183
* @return string
184184
*/
185-
public function getReplyToEmail(): string
185+
public function getReplyToEmail(): ?string
186186
{
187-
return $this->replyTo->getEmail();
187+
if ($this->replyTo) {
188+
return $this->replyTo->getEmail();
189+
}
190+
191+
return null;
188192
}
189193

190194
/**
191195
* @return string
192196
*/
193-
public function getReplyToName(): string
197+
public function getReplyToName(): ?string
194198
{
195-
return $this->replyTo->getName();
199+
if ($this->replyTo) {
200+
return $this->replyTo->getName();
201+
}
202+
203+
return null;
196204
}
197205

198206
/**

0 commit comments

Comments
 (0)