fix: crash in message.combineParts when copying a nil slice

This commit is contained in:
James Houlahan
2020-06-03 13:52:11 +02:00
parent 6070a3b7cc
commit 80b2bfc2a5
2 changed files with 4 additions and 0 deletions

View File

@ -140,6 +140,9 @@ func combineParts(m *pmapi.Message, parts []io.Reader, headers []textproto.MIMEH
att := parseAttachment(filename, mediaType, h)
b := &bytes.Buffer{}
if d == nil {
continue
}
if _, err = io.Copy(b, d); err != nil {
continue
}