[6.8.0]fix IndexOutOfBoundsException

This commit is contained in:
xuxinchao
2024-11-15 12:02:12 +08:00
parent 434ebd2b99
commit 3f88018245

View File

@@ -45,11 +45,13 @@ class TakeOverListAdapter(private val context: Context): RecyclerView.Adapter<Ta
* 修改元素
*/
fun notifyRecordItemChanged(info: TakeOverRecordInfo){
val pos = data?.indexOf(info)
pos?.let {
data?.set(pos, info)
notifyItemChanged(pos)
}
try {
val pos = data?.indexOf(info)
pos?.let {
data?.set(pos, info)
notifyItemChanged(pos)
}
}catch (_:Exception){}
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TakeOverRecordHolder {