From dc8726e513582c97bd71a3a39511f18f497db2d3 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 15 Oct 2020 21:46:15 +0200 Subject: [PATCH] Fixed rare crash --- app/src/main/java/eu/faircode/email/HtmlHelper.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index 70efaa60b7..df00d7a41a 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -298,7 +298,7 @@ public class HtmlHelper { Log.e(ex); Document document = Document.createShell(""); Element strong = document.createElement("strong"); - strong.text(Log.formatThrowable(ex)); + strong.text(android.util.Log.getStackTraceString(ex)); document.body().appendChild(strong); return document; } @@ -312,7 +312,7 @@ public class HtmlHelper { Log.e(ex); Document document = Document.createShell(""); Element strong = document.createElement("strong"); - strong.text(Log.formatThrowable(ex)); + strong.text(android.util.Log.getStackTraceString(ex)); document.body().appendChild(strong); return document; } @@ -389,7 +389,8 @@ public class HtmlHelper { if (tag.contains(":")) { if (display_hidden || ns == null || tag.startsWith(ns)) { - e.tagName(tag.split(":")[1]); + String[] nstag = tag.split(":"); + e.tagName(nstag[nstag.length > 1 ? 1 : 0]); Log.i("Updated tag=" + tag + " to=" + e.tagName()); } else { e.remove();