Skip to content
Snippets Groups Projects
Commit 33116907 authored by Duncan McNamara's avatar Duncan McNamara
Browse files

History: fix double click outOfBoundsException

When pressing on two history items at the same time, it sometimes tries
to access an item with position -1 which causes an outOfBoundsException.

Closes #2294
parent 50caf377
No related branches found
No related tags found
1 merge request!1216History: fix double click outOfBoundsException
Pipeline #175845 passed with stage
in 2 minutes and 40 seconds
......@@ -269,13 +269,15 @@ class MoreFragment : BaseFragment(), IRefreshable, IHistory, IDialogManager,
}
private fun Click.process() {
val item = viewModel.dataset.get(position)
when (this) {
is SimpleClick -> onClick(position, item)
is LongClick -> onLongClick(position, item)
is ImageClick -> {
if (actionMode != null) onClick(position, item)
else onLongClick(position, item)
if (position >= 0) {
val item = viewModel.dataset.get(position)
when (this) {
is SimpleClick -> onClick(position, item)
is LongClick -> onLongClick(position, item)
is ImageClick -> {
if (actionMode != null) onClick(position, item)
else onLongClick(position, item)
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment