From e58885cf57cce36d3b52e4d777f3de90281e7286 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 18 Jul 2021 15:00:58 +0200 Subject: [PATCH] Prevent crash --- app/src/main/java/eu/faircode/email/FragmentMessages.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 9f44d2ad75..acc5afaacd 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -6652,11 +6652,13 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. // https://autocrypt.org/level1.html#the-autocrypt-header Map kv = MessageHelper.getKeyValues(message.autocrypt); for (String key : kv.keySet()) { - String value = kv.get(key).toLowerCase(Locale.ROOT); + String value = kv.get(key); Log.i("Autocrypt " + key + "=" + value); + if (value == null) + continue; switch (key) { case "addr": - addr = value; + addr = value.toLowerCase(Locale.ROOT); break; case "prefer-encrypt": mutual = value.trim().toLowerCase(Locale.ROOT).equals("mutual");