Fix crash in ViewThreadFragment.removeItem (#3622)
This commit is contained in:
parent
80774f35f8
commit
d2747811be
1 changed files with 7 additions and 6 deletions
|
@ -416,7 +416,7 @@ class ViewThreadFragment :
|
||||||
}
|
}
|
||||||
|
|
||||||
public override fun removeItem(position: Int) {
|
public override fun removeItem(position: Int) {
|
||||||
val status = adapter.currentList[position]
|
adapter.currentList.getOrNull(position)?.let { status ->
|
||||||
if (status.isDetailed) {
|
if (status.isDetailed) {
|
||||||
// the main status we are viewing is being removed, finish the activity
|
// the main status we are viewing is being removed, finish the activity
|
||||||
activity?.finish()
|
activity?.finish()
|
||||||
|
@ -424,6 +424,7 @@ class ViewThreadFragment :
|
||||||
}
|
}
|
||||||
viewModel.removeStatus(status)
|
viewModel.removeStatus(status)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun onVoteInPoll(position: Int, choices: List<Int>) {
|
override fun onVoteInPoll(position: Int, choices: List<Int>) {
|
||||||
val status = adapter.currentList[position]
|
val status = adapter.currentList[position]
|
||||||
|
|
Loading…
Reference in a new issue