1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-30 13:12:25 -05:00

Avoid IllegalArgumentException for Charset.forName(null).

This commit is contained in:
Koji Arai 2011-03-01 01:50:56 +09:00
parent 203dab5c64
commit da34a5ec8c

View File

@ -101,7 +101,12 @@ public class MimeHeader {
String v = field.value; String v = field.value;
if (hasToBeEncoded(v)) { if (hasToBeEncoded(v)) {
v = EncoderUtil.encodeEncodedWord(field.value, Charset.forName(mCharset)); Charset charset = null;
if (mCharset != null) {
charset = Charset.forName(mCharset);
}
v = EncoderUtil.encodeEncodedWord(field.value, charset);
} }
writer.write(field.name + ": " + v + "\r\n"); writer.write(field.name + ": " + v + "\r\n");