Merge pull request #2191 from element-hq/feature/bma/fixRRCrash
Do not use sublist as it crashes if `index > items.count()`.
This commit is contained in:
commit
3846c6778d
1 changed files with 2 additions and 1 deletions
|
|
@ -247,7 +247,8 @@ class TimelinePresenter @AssistedInject constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getLastEventIdBeforeOrAt(index: Int, items: ImmutableList<TimelineItem>): EventId? {
|
private fun getLastEventIdBeforeOrAt(index: Int, items: ImmutableList<TimelineItem>): EventId? {
|
||||||
for (item in items.subList(index, items.count())) {
|
for (i in index until items.count()) {
|
||||||
|
val item = items[i]
|
||||||
if (item is TimelineItem.Event) {
|
if (item is TimelineItem.Event) {
|
||||||
return item.eventId
|
return item.eventId
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue