From 0bb115ca42469fdfb0c652bd3a126a707eb37e76 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 29 Jul 2010 22:17:29 +0000 Subject: [PATCH] Actually catch an OOM in getTextFromPart Backport an update to getTextFromPart from AOSP as of 290348 - dealing with OOM as we import large messages --- src/com/fsck/k9/mail/internet/MimeUtility.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/com/fsck/k9/mail/internet/MimeUtility.java b/src/com/fsck/k9/mail/internet/MimeUtility.java index a0a55635e..2db9d6812 100644 --- a/src/com/fsck/k9/mail/internet/MimeUtility.java +++ b/src/com/fsck/k9/mail/internet/MimeUtility.java @@ -398,6 +398,15 @@ public class MimeUtility return result; } } + + } + catch (OutOfMemoryError oom) + { + /* + * If we are not able to process the body there's nothing we can do about it. Return + * null and let the upper layers handle the missing content. + */ + Log.e(K9.LOG_TAG, "Unable to getTextFromPart " + oom.toString()); } catch (Exception e) {