mirror of https://github.com/M66B/FairEmail.git
Prevent crash
This commit is contained in:
parent
75b77791b4
commit
bfc8471360
|
@ -95,19 +95,13 @@ public class ActivityCompose extends ActivityBase implements FragmentManager.OnB
|
||||||
// https://www.ietf.org/rfc/rfc2368.txt
|
// https://www.ietf.org/rfc/rfc2368.txt
|
||||||
MailTo mailto = MailTo.parse(uri.toString());
|
MailTo mailto = MailTo.parse(uri.toString());
|
||||||
|
|
||||||
String _to = mailto.getTo();
|
List<String> to = sanitize(new String[]{mailto.getTo()});
|
||||||
if (_to != null) {
|
if (to.size() == 1)
|
||||||
List<String> to = sanitize(new String[]{_to});
|
args.putString("to", to.get(0));
|
||||||
if (to.size() == 1)
|
|
||||||
args.putString("to", to.get(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
String _cc = mailto.getCc();
|
List<String> cc = sanitize(new String[]{mailto.getCc()});
|
||||||
if (_cc != null) {
|
if (cc.size() == 1)
|
||||||
List<String> cc = sanitize(new String[]{_cc});
|
args.putString("cc", cc.get(0));
|
||||||
if (cc.size() == 1)
|
|
||||||
args.putString("cc", cc.get(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
String subject = mailto.getSubject();
|
String subject = mailto.getSubject();
|
||||||
if (subject != null)
|
if (subject != null)
|
||||||
|
@ -220,6 +214,8 @@ public class ActivityCompose extends ActivityBase implements FragmentManager.OnB
|
||||||
List<String> result = new ArrayList<>();
|
List<String> result = new ArrayList<>();
|
||||||
if (addresses != null)
|
if (addresses != null)
|
||||||
for (String address : addresses) {
|
for (String address : addresses) {
|
||||||
|
if (!TextUtils.isEmpty(address))
|
||||||
|
continue;
|
||||||
address = address.replaceAll("\\s+", "");
|
address = address.replaceAll("\\s+", "");
|
||||||
address = address.replaceAll("\u200b", ""); // Discord: zero width space
|
address = address.replaceAll("\u200b", ""); // Discord: zero width space
|
||||||
if (!TextUtils.isEmpty(address))
|
if (!TextUtils.isEmpty(address))
|
||||||
|
|
Loading…
Reference in New Issue