Do not crash if we try to access an item outside of the bounds of the conversation.

fork-5.53.8
Alex Hart 2021-06-28 18:58:56 -03:00 zatwierdzone przez Greyson Parrelli
rodzic d4a3b442f4
commit 44119b6437
1 zmienionych plików z 7 dodań i 1 usunięć

Wyświetl plik

@ -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;
}
}
}