mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-15 02:12:55 +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:
|
// Returns:
|
||||||
// - An error if the disconnection fails; otherwise, returns nil.
|
// - An error if the disconnection fails; otherwise, returns nil.
|
||||||
func (c *Client) Close() error {
|
func (c *Client) Close() error {
|
||||||
if !c.smtpClient.HasConnection() {
|
if c.smtpClient == nil || !c.smtpClient.HasConnection() {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if err := c.smtpClient.Quit(); err != nil {
|
if err := c.smtpClient.Quit(); err != nil {
|
||||||
|
|
Loading…
Reference in a new issue