From cfb68b904cc655f9ee0862ada0deba8edee48b67 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 4 Sep 2018 19:45:20 +0000 Subject: [PATCH] Handle exceptions without message --- app/src/main/java/eu/faircode/email/Helper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/Helper.java b/app/src/main/java/eu/faircode/email/Helper.java index 07148ac8b4..d5b53bc528 100644 --- a/app/src/main/java/eu/faircode/email/Helper.java +++ b/app/src/main/java/eu/faircode/email/Helper.java @@ -109,10 +109,10 @@ public class Helper { static String formatThrowable(Throwable ex) { StringBuilder sb = new StringBuilder(); - sb.append(ex.getMessage()); + sb.append(ex.getMessage() == null ? ex.getClass().getName() : ex.getMessage()); Throwable cause = ex.getCause(); while (cause != null) { - sb.append(" ").append(cause.getMessage()); + sb.append(" ").append(cause.getMessage() == null ? cause.getClass().getName() : cause.getMessage()); cause = cause.getCause(); } return sb.toString();