1
0

fix: panic when no params available

This commit is contained in:
James Houlahan
2020-08-06 15:31:45 +02:00
parent 0e7e13211b
commit 65d8b382d0
2 changed files with 5 additions and 1 deletions

View File

@ -75,7 +75,11 @@ func (p *Part) ConvertToUTF8() error {
} }
// HELP: Is this okay? What about when the charset is embedded in structured text type eg html/xml? // HELP: Is this okay? What about when the charset is embedded in structured text type eg html/xml?
if params == nil {
params = make(map[string]string)
}
params["charset"] = "utf-8" params["charset"] = "utf-8"
p.Header.SetContentType(t, params) p.Header.SetContentType(t, params)
return nil return nil

View File

@ -38,4 +38,4 @@ Feature: SMTP wrong messages
""" """
Then SMTP response is "SMTP error: 554 Error: transaction failed, blame it on the weather: multipart: NextPart: EOF" Then SMTP response is "SMTP error: 554 Error: transaction failed, blame it on the weather: unexpected EOF"