mirror of
https://github.com/wneessen/go-mail.git
synced 2024-12-23 02:50:39 +01:00
Refactor error checking in msg.SendErrorIsTemp()
Added an additional condition in the SendErrorIsTemp function within msg.go to ensure that the error e is not nil before referencing it. This guards against potential runtime panics from dereferencing a nil pointer, enhancing robustness of error handling.
This commit is contained in:
parent
a50a3ceb18
commit
ca896bd641
1 changed files with 1 additions and 1 deletions
2
msg.go
2
msg.go
|
@ -1074,7 +1074,7 @@ func (m *Msg) HasSendError() bool {
|
|||
// corresponding error was of temporary nature and should be retried later
|
||||
func (m *Msg) SendErrorIsTemp() bool {
|
||||
var e *SendError
|
||||
if errors.As(m.sendError, &e) {
|
||||
if errors.As(m.sendError, &e) && e != nil {
|
||||
return e.isTemp
|
||||
}
|
||||
return false
|
||||
|
|
Loading…
Reference in a new issue