Remove redundant nil check for SMTP client

The removed check for a nil SMTP client was redundant because the previous error handling already covers this case. Streamlining this part of the code improves readability and reduces unnecessary checks.
This commit is contained in:
Winni Neessen 2024-11-22 16:22:53 +01:00
parent c61aad4fcb
commit 6ebc60d1df
Signed by: wneessen
GPG key ID: 385AC9889632126E

View file

@ -1017,9 +1017,6 @@ func (c *Client) DialToSMTPClientWithContext(ctxDial context.Context) (*smtp.Cli
if err != nil {
return nil, err
}
if client == nil {
return nil, fmt.Errorf("SMTP client is nil")
}
if c.logger != nil {
client.SetLogger(c.logger)