Catch parse OOM

This commit is contained in:
M66B 2021-06-07 22:00:26 +02:00
parent cebc18794f
commit 9357cceb86
1 changed files with 114 additions and 109 deletions

View File

@ -2369,6 +2369,7 @@ public class MessageHelper {
try {
ensureStructure();
try {
MimePart part = imessage;
if (part.isMimeType("multipart/mixed")) {
@ -2486,8 +2487,13 @@ public class MessageHelper {
Log.e(ct.toString());
}
}
} catch (ParseException | OutOfMemoryError ex) {
} catch (ParseException ex) {
Log.w(ex);
}
getMessageParts(imessage, parts, null);
} catch (OutOfMemoryError ex) {
Log.e(ex);
parts.warnings.add(Log.formatThrowable(ex, false));
/*
java.lang.OutOfMemoryError: Failed to allocate a xxx byte allocation with yyy free bytes and zzMB until OOM
@ -2503,7 +2509,6 @@ public class MessageHelper {
*/
}
getMessageParts(imessage, parts, null);
return parts;
}