From 7407a05d284a468b2730002d162cc8312f0ff332 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 23 Jul 2022 13:06:02 +0200 Subject: [PATCH] Prevent null References --- app/src/main/java/eu/faircode/email/FragmentCompose.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index cd04ee222f..1a76074ea4 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -4858,7 +4858,10 @@ public class FragmentCompose extends FragmentBase { // https://tools.ietf.org/html/rfc5322#section-3.6.4 // The "References:" field will contain the contents of the parent's "References:" field (if any) // followed by the contents of the parent's "Message-ID:" field (if any). - data.draft.references = (ref.references == null ? "" : ref.references + " ") + ref.msgid; + String refs = (ref.references == null ? "" : ref.references); + if (!TextUtils.isEmpty(ref.msgid)) + refs = (TextUtils.isEmpty(refs) ? ref.msgid : refs + " " + ref.msgid); + data.draft.references = refs; data.draft.inreplyto = ref.msgid; data.draft.thread = ref.thread;