diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeParentItemAdapter.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeParentItemAdapter.kt index 50111428..03ec1a6c 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeParentItemAdapter.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeParentItemAdapter.kt @@ -72,7 +72,7 @@ open class ParentItemAdapter( open fun onSaveInstanceState(outState: Bundle, recyclerView: RecyclerView? = null) { if (recyclerView != null) { - for (position in items.indices) { + for (position in 0..itemCount) { val holder = recyclerView.findViewHolderForAdapterPosition(position) ?: continue saveHolder(holder) } @@ -329,4 +329,4 @@ class SearchDiffCallback( override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean = oldList[oldItemPosition] == newList[newItemPosition] -} \ No newline at end of file +}