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?
if params == nil {
params = make(map[string]string)
}
params["charset"] = "utf-8"
p.Header.SetContentType(t, params)
return nil