Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 162b7e34 authored by Erik's avatar Erik
Browse files

b/5317367 Check if cursor is empty before reading

Change-Id: I09f07eda5b0d1eaf20eae9e210eabb6e90612810
parent 4254f97e
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -331,10 +331,11 @@ public class ContactSaveService extends IntentService {
                            new String[] {Contacts._ID, Contacts.LOOKUP_KEY},
                            null, null, null);
                    try {
                        c.moveToFirst();
                        if (c.moveToFirst()) {
                            final long contactId = c.getLong(0);
                            final String lookupKey = c.getString(1);
                            lookupUri = Contacts.getLookupUri(contactId, lookupKey);
                        }
                    } finally {
                        c.close();
                    }