Do not crash if we try to access an item outside of the bounds of the conversation.
This commit is contained in:
parent
d4a3b442f4
commit
44119b6437
1 changed files with 7 additions and 1 deletions
|
@ -387,7 +387,13 @@ public class ConversationAdapter
|
|||
if (pagingController != null) {
|
||||
pagingController.onDataNeededAroundIndex(correctedPosition);
|
||||
}
|
||||
return super.getItem(correctedPosition);
|
||||
|
||||
if (correctedPosition < getItemCount()) {
|
||||
return super.getItem(correctedPosition);
|
||||
} else {
|
||||
Log.d(TAG, "Could not access corrected position " + correctedPosition + " as it is out of bounds.");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue