Catch ParseException on get HTML

pull/156/head
M66B 5 years ago
parent 77beca5a34
commit 736e8d4dba

@ -800,10 +800,11 @@ public class MessageHelper {
throw new FolderClosedException(ex.getFolder(), "getHtml", ex);
} catch (Throwable ex) {
Log.w(ex);
text = true;
result = ex + "\n" + android.util.Log.getStackTraceString(ex);
warnings.add(ex.getMessage());
return null;
}
try {
ContentType ct = new ContentType(part.getContentType());
String charset = ct.getParameter("charset");
if (TextUtils.isEmpty(charset)) {
@ -818,6 +819,10 @@ public class MessageHelper {
!"US-ASCII".equals(charset.toUpperCase()))
warnings.add(context.getString(R.string.title_no_charset, charset));
}
} catch (ParseException ex) {
Log.w(ex);
warnings.add(ex.getMessage());
}
if (part.isMimeType("text/plain") || text) {
result = TextUtils.htmlEncode(result);

Loading…
Cancel
Save