From 48a75e068cb6cb61e06c9f90a05977f3da5fa7a8 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 11 Nov 2019 20:23:34 +0100 Subject: [PATCH] Catch OOM --- app/src/main/java/eu/faircode/email/HtmlHelper.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index dd7c94574c..124c946d45 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -609,6 +609,15 @@ public class HtmlHelper { } static String getPreview(String body) { + try { + return _getPreview(body); + } catch (OutOfMemoryError ex) { + Log.e(ex); + return null; + } + } + + private static String _getPreview(String body) { if (body == null) return null;