Fix crash when ViewHolder's adapterPosition is -1

This should address #1340
This commit is contained in:
moezbhatti
2019-04-01 02:30:13 -04:00
parent 408eca5b2b
commit 0f7714138e
8 changed files with 27 additions and 17 deletions
@@ -89,7 +89,7 @@ class GalleryPagerAdapter @Inject constructor(private val context: Context) : Qk
}
override fun onBindViewHolder(holder: QkViewHolder, position: Int) {
val part = getItem(position)!!
val part = getItem(position) ?: return
val view = holder.containerView
when (getItemViewType(position)) {
VIEW_TYPE_IMAGE -> {