Skip to content

Commit

Permalink
Merge pull request #292 from ChanakaWeerasinghe/patch-1
Browse files Browse the repository at this point in the history
java.lang.NullPointerException
  • Loading branch information
lukasgit authored Dec 14, 2022
2 parents 879e0fa + 7f7516f commit c901a28
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,15 @@ public boolean onActivityResult(int requestCode, int resultCode, Intent intent)
return true;
}
Uri contactUri = intent.getData();
if (intent != null){
Cursor cursor = contentResolver.query(contactUri, null, null, null, null);
if (cursor.moveToFirst()) {
String id = contactUri.getLastPathSegment();
getContacts("openDeviceContactPicker", id, false, false, false, localizedLabels, this.result);
} else {
Log.e(LOG_TAG, "onActivityResult - cursor.moveToFirst() returns false");
finishWithResult(FORM_OPERATION_CANCELED);
}
}}else{return true;}
cursor.close();
return true;
}
Expand Down

0 comments on commit c901a28

Please sign in to comment.