forked from upstream-mirrors/quik
Fix crash when ViewHolder's adapterPosition is -1
This should address #1340
This commit is contained in:
+2
-2
@@ -56,14 +56,14 @@ class ScheduledMessageAdapter @Inject constructor(
|
||||
|
||||
return QkViewHolder(view).apply {
|
||||
view.setOnClickListener {
|
||||
val message = getItem(adapterPosition)!!
|
||||
val message = getItem(adapterPosition) ?: return@setOnClickListener
|
||||
clicks.onNext(message.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: QkViewHolder, position: Int) {
|
||||
val message = getItem(position)!!
|
||||
val message = getItem(position) ?: return
|
||||
val view = holder.containerView
|
||||
|
||||
// GroupAvatarView only accepts recipients, so map the phone numbers to recipients
|
||||
|
||||
Reference in New Issue
Block a user