add some IndexOutOfBoundsException checks at adapters
This commit is contained in:
parent
50ee6d5abb
commit
6ca5191500
|
@ -61,7 +61,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
|
|||
}
|
||||
|
||||
override fun onBindViewHolder(holder: MyRecyclerViewAdapter.ViewHolder, position: Int) {
|
||||
val dir = dirs[position]
|
||||
val dir = dirs.getOrNull(position) ?: return
|
||||
val view = holder.bindView(dir, !isPickIntent) { itemView, adapterPosition ->
|
||||
setupView(itemView, dir)
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList<Medium>,
|
|||
}
|
||||
|
||||
override fun onBindViewHolder(holder: MyRecyclerViewAdapter.ViewHolder, position: Int) {
|
||||
val medium = media[position]
|
||||
val medium = media.getOrNull(position) ?: return
|
||||
visibleItemPaths.add(medium.path)
|
||||
val view = holder.bindView(medium, !allowMultiplePicks) { itemView, adapterPosition ->
|
||||
setupView(itemView, medium)
|
||||
|
|
Loading…
Reference in New Issue