Fix crash when profile screen disappears

This commit is contained in:
Shadowfacts 2021-01-20 18:41:24 -05:00
parent d1c45a87e6
commit cdffda5593
1 changed files with 3 additions and 1 deletions

View File

@ -117,7 +117,9 @@ class TimelineLikeTableViewController<Item>: EnhancedTableViewController, Refres
}
private func pruneOffscreenRows() {
guard let lastVisibleRow = lastLastVisibleRow else {
guard let lastVisibleRow = lastLastVisibleRow,
// never remove the last section
sections.count - headerSectionsCount() > 1 else {
return
}
let lastSectionIndex = sections.count - 1