Skip to content

Commit

Permalink
fix: Null Pointer when a Contact is being recorded and another Contac…
Browse files Browse the repository at this point in the history
…t is deleted at the same time
  • Loading branch information
kaushiknsanji committed Nov 11, 2019
1 parent 3508b06 commit 8ace8ad
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1666,7 +1666,8 @@ private boolean isContactDuplicate(int position, String contactValue) {
int noOfTrackedContacts = mTrackerContactValuesSparseArray.size();
//Iterating over the SparseArray Tracker to check if the contact value is a duplicate
for (int index = 0; index < noOfTrackedContacts; index++) {
if (mTrackerContactValuesSparseArray.valueAt(index).equals(contactValue)
if (mTrackerContactValuesSparseArray.valueAt(index) != null
&& mTrackerContactValuesSparseArray.valueAt(index).equals(contactValue)
&& mTrackerContactValuesSparseArray.keyAt(index) != position) {
//Returning true when the Contact value is duplicated
//and is not for the same item view position
Expand Down

0 comments on commit 8ace8ad

Please sign in to comment.