Skip to content

Commit

Permalink
fix crash:
Browse files Browse the repository at this point in the history
  • Loading branch information
krasanen committed Feb 2, 2024
1 parent c20e17b commit 15e38b4
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ protected ArrayList<ContactsPojo> doInBackground(Void... params) {
int isPrimaryIndex = cur.getColumnIndex(ContactsContract.CommonDataKinds.Phone.IS_PRIMARY);
int photoIdIndex = cur.getColumnIndex(ContactsContract.Contacts.PHOTO_ID);

while (cur.moveToNext()) {
while (cur.moveToNext() && lookupIndex!=-1) {
String lookupKey = cur.getString(lookupIndex);
Integer timesContacted = cur.getInt(timesContactedIndex);
String name = cur.getString(displayNameIndex);
Expand Down Expand Up @@ -136,7 +136,7 @@ protected ArrayList<ContactsPojo> doInBackground(Void... params) {
if (nickCursor.getCount() > 0) {
int lookupKeyIndex = nickCursor.getColumnIndex(ContactsContract.Data.LOOKUP_KEY);
int nickNameIndex = nickCursor.getColumnIndex(ContactsContract.CommonDataKinds.Nickname.NAME);
while (nickCursor.moveToNext()) {
while (nickCursor.moveToNext() && lookupKeyIndex!=-1) {
String lookupKey = nickCursor.getString(lookupKeyIndex);
String nick = nickCursor.getString(nickNameIndex);

Expand Down Expand Up @@ -166,7 +166,7 @@ protected ArrayList<ContactsPojo> doInBackground(Void... params) {
int lookupKeyIndex = workCursor.getColumnIndex(ContactsContract.Data.LOOKUP_KEY);
int companyIndex = workCursor.getColumnIndex(ContactsContract.CommonDataKinds.Organization.COMPANY);
int titleIndex = workCursor.getColumnIndex(ContactsContract.CommonDataKinds.Organization.TITLE);
while (workCursor.moveToNext()) {
while (workCursor.moveToNext() && lookupKeyIndex!=-1) {
String lookupKey = workCursor.getString(lookupKeyIndex);
String title = workCursor.getString(titleIndex);
String company = workCursor.getString(companyIndex);
Expand Down Expand Up @@ -224,7 +224,7 @@ protected ArrayList<ContactsPojo> doInBackground(Void... params) {
int mimeTypeKeyIndex = msgCursor.getColumnIndex(ContactsContract.Data.MIMETYPE);
int contactIdIndex = msgCursor.getColumnIndex(ContactsContract.Data._ID);

while (msgCursor.moveToNext()) {
while (msgCursor.moveToNext() && lookupKeyIndex!=-1) {
String lookupKey = msgCursor.getString(lookupKeyIndex);
String mimeType = msgCursor.getString(mimeTypeKeyIndex);
String email = msgCursor.getString(emailIndex);
Expand Down

0 comments on commit 15e38b4

Please sign in to comment.