From 79aa5ad5871bd495c6e7c8416458453d1e7fe31b Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Fri, 12 Jul 2024 23:55:00 +0200 Subject: [PATCH] fix crash on some mailto: links if the value part is missing, it otherwise crashes when calling MailtoUtil.getText() and the exception is not handled there (it is not in at least one case). therefore, just catch the exception in this cornercase (same for bad encoding) and return an empty string. --- src/main/java/org/thoughtcrime/securesms/util/MailtoUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/thoughtcrime/securesms/util/MailtoUtil.java b/src/main/java/org/thoughtcrime/securesms/util/MailtoUtil.java index c5d962488..808db7f74 100644 --- a/src/main/java/org/thoughtcrime/securesms/util/MailtoUtil.java +++ b/src/main/java/org/thoughtcrime/securesms/util/MailtoUtil.java @@ -54,7 +54,7 @@ public class MailtoUtil { String[] queryEntryArray = queryEntry.split(KEY_VALUE_SEPARATOR); try { mailtoQueryMap.put(queryEntryArray[0], URLDecoder.decode(queryEntryArray[1], "UTF-8")); - } catch (UnsupportedEncodingException e) { + } catch (Exception e) { e.printStackTrace(); } }