Possibly fixed crash with tristate preference

This commit is contained in:
Jays2Kings 2021-07-14 13:07:24 -04:00
parent f56fe25010
commit 9f26d142e2

View File

@ -94,7 +94,7 @@ internal class QuadStateMultiChoiceDialogAdapter(
) { ) {
holder.isEnabled = !disabledIndices.contains(position) holder.isEnabled = !disabledIndices.contains(position)
holder.controlView.state = states[currentSelection[position]] holder.controlView.state = states.getOrNull(currentSelection[position]) ?: QuadStateCheckBox.State.UNCHECKED
holder.controlView.updateDrawable() holder.controlView.updateDrawable()
holder.titleView.text = items[position] holder.titleView.text = items[position]
holder.itemView.background = dialog.getItemSelector() holder.itemView.background = dialog.getItemSelector()