Skip to content

Commit

Permalink
Fix: add a position check for pagingDataAdapter in SearchResultsFragm…
Browse files Browse the repository at this point in the history
…ent (#4887)
  • Loading branch information
cooltey authored Aug 22, 2024
1 parent fb26cae commit 4c57828
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,10 @@ class SearchResultsFragment : Fragment() {
}

override fun onBindViewHolder(holder: DefaultViewHolder<View>, pos: Int) {
getItem(pos)?.let {
(holder as SearchResultItemViewHolder).bindItem(pos, it)
if (pos in 0..<itemCount) {
getItem(pos)?.let {
(holder as SearchResultItemViewHolder).bindItem(pos, it)
}
}
}
}
Expand Down

0 comments on commit 4c57828

Please sign in to comment.