1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-29 03:05:31 +00:00

Prevent crash

This commit is contained in:
M66B 2021-10-26 07:56:37 +02:00
parent 4803a1ecbd
commit 30590c29fa

View file

@ -521,11 +521,14 @@ public class ContactInfo {
if (info.displayName == null)
info.displayName = address.getPersonal();
if (!info.known && !TextUtils.isEmpty(info.email)) {
DB db = DB.getInstance(context);
EntityContact contact = db.contact().getContact(account, EntityContact.TYPE_TO, info.email);
info.known = (contact != null);
}
if (!info.known && !TextUtils.isEmpty(info.email))
try {
DB db = DB.getInstance(context);
EntityContact contact = db.contact().getContact(account, EntityContact.TYPE_TO, info.email);
info.known = (contact != null);
} catch (Throwable ex) {
Log.e(ex);
}
synchronized (emailContactInfo) {
emailContactInfo.put(key, info);