1
0
mirror of https://github.com/etesync/android synced 2024-12-23 15:18:14 +00:00

Check for null values in relations (should fix #547)

This commit is contained in:
Ricki Hirner 2015-06-14 12:07:04 +02:00
parent 534953fe4c
commit 654af1eec5

View File

@ -566,10 +566,14 @@ public class LocalAddressBook extends LocalCollection<Contact> {
protected void populateRelation(Contact c, ContentValues row) throws RemoteException {
String name = row.getAsString(Relation.NAME);
// don't process empty relations
if (StringUtils.isEmpty(name))
return;
// find relation by name or create new one
Related related = null;
for (Related rel : c.getRelations()) {
if (rel.getText().equals(name)) {
if (name.equals(rel.getText())) {
related = rel;
break;
}