mirror of https://github.com/M66B/FairEmail.git
Prevent NPE
This commit is contained in:
parent
683a300123
commit
19baa1e928
|
@ -377,19 +377,20 @@ public class EntityMessage implements Serializable {
|
||||||
DB db = DB.getInstance(context);
|
DB db = DB.getInstance(context);
|
||||||
|
|
||||||
boolean notJunk = false;
|
boolean notJunk = false;
|
||||||
for (Address sender : from) {
|
if (from != null)
|
||||||
String email = ((InternetAddress) sender).getAddress();
|
for (Address sender : from) {
|
||||||
if (TextUtils.isEmpty(email))
|
String email = ((InternetAddress) sender).getAddress();
|
||||||
continue;
|
if (TextUtils.isEmpty(email))
|
||||||
|
continue;
|
||||||
|
|
||||||
EntityContact contact = db.contact().getContact(account, EntityContact.TYPE_NO_JUNK, email);
|
EntityContact contact = db.contact().getContact(account, EntityContact.TYPE_NO_JUNK, email);
|
||||||
if (contact != null) {
|
if (contact != null) {
|
||||||
contact.times_contacted++;
|
contact.times_contacted++;
|
||||||
contact.last_contacted = new Date().getTime();
|
contact.last_contacted = new Date().getTime();
|
||||||
db.contact().updateContact(contact);
|
db.contact().updateContact(contact);
|
||||||
notJunk = true;
|
notJunk = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return notJunk;
|
return notJunk;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue