mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-22 13:50:49 +01:00
Merge pull request #139 from wneessen/bugfix/138_segfault-in-writer-because-createpart-error-is-ignored
Fix nil pointer dereference in msgwriter due to missing error handling
This commit is contained in:
commit
05c2105705
1 changed files with 4 additions and 1 deletions
|
@ -231,9 +231,12 @@ func (mw *msgWriter) addFiles(fl []*File, a bool) {
|
|||
if mw.d > 0 {
|
||||
mw.newPart(f.Header)
|
||||
}
|
||||
|
||||
if mw.err == nil {
|
||||
mw.writeBody(f.Writer, e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// newPart creates a new MIME multipart io.Writer and sets the partwriter to it
|
||||
func (mw *msgWriter) newPart(h map[string][]string) {
|
||||
|
|
Loading…
Reference in a new issue