Skip to content

Commit c2139ba

Browse files
committed
nil check
1 parent 62b5efe commit c2139ba

File tree

1 file changed

+3
-0
lines changed
  • coderd/notifications/dispatch/smtptest

1 file changed

+3
-0
lines changed

coderd/notifications/dispatch/smtptest/server.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ func (b *Backend) NewSession(c *smtp.Conn) (smtp.Session, error) {
5959
func (b *Backend) LastMessage() *Message {
6060
b.mu.Lock()
6161
defer b.mu.Unlock()
62+
if b.lastMsg == nil {
63+
return nil
64+
}
6265
clone := *b.lastMsg
6366
clone.To = slices.Clone(b.lastMsg.To)
6467
return &clone

0 commit comments

Comments
 (0)