Skip to content

Commit

Permalink
fix: Prevent crash if getItem throws IndexOutOfBoundsException (#1138)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikclayton authored Nov 26, 2024
1 parent 4c7436f commit 9bc17f0
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ class TimelinePagingAdapter(
position: Int,
payloads: List<*>?,
) {
getItem(position)?.let {
try {
getItem(position)
} catch (e: IndexOutOfBoundsException) {
null
}?.let {
(viewHolder as StatusViewHolder<StatusViewData>).setupWithStatus(
pachliAccountId,
it,
Expand Down

0 comments on commit 9bc17f0

Please sign in to comment.