mirror of
https://github.com/wneessen/go-mail.git
synced 2024-12-23 02:50:39 +01:00
Handle nil pointer in IsTemp method in senderror.go
Added a nil check in the IsTemp method in senderror.go to prevent runtime errors when method is called on a nil object. The method now immediately returns false if it is invoked on a nil *SendError, ensuring the program's robustness against potential misuse. This increases the robustness and readability of the
This commit is contained in:
parent
468e1e2b2c
commit
cf678be9dd
1 changed files with 3 additions and 0 deletions
|
@ -106,6 +106,9 @@ func (e *SendError) Is(et error) bool {
|
|||
|
||||
// IsTemp returns true if the delivery error is of temporary nature and can be retried
|
||||
func (e *SendError) IsTemp() bool {
|
||||
if e == nil {
|
||||
return false
|
||||
}
|
||||
return e.isTemp
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue