mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-21 21:30:50 +01:00
Merge branch 'main' into test_close_on_nil
This commit is contained in:
commit
03e53cbabc
1 changed files with 1 additions and 1 deletions
|
@ -996,7 +996,7 @@ func (c *Client) DialWithContext(dialCtx context.Context) error {
|
|||
// Returns:
|
||||
// - An error if the disconnection fails; otherwise, returns nil.
|
||||
func (c *Client) Close() error {
|
||||
if !c.smtpClient.HasConnection() {
|
||||
if c.smtpClient == nil || !c.smtpClient.HasConnection() {
|
||||
return nil
|
||||
}
|
||||
if err := c.smtpClient.Quit(); err != nil {
|
||||
|
|
Loading…
Reference in a new issue