Fix crash when attempting to prune offscreen rows without content sections

This commit is contained in:
Shadowfacts 2022-03-29 12:20:32 -04:00
parent 705fbbe343
commit 830eea5e95
1 changed files with 3 additions and 1 deletions

View File

@ -77,7 +77,9 @@ class DiffableTimelineLikeTableViewController<Section: Hashable & CaseIterable,
let contentSections = snapshot.sectionIdentifiers.filter { timelineContentSections().contains($0) }
let contentSectionIndices = contentSections.compactMap(snapshot.indexOfSection(_:))
let maxContentSectionIndex = contentSectionIndices.max()!
guard let maxContentSectionIndex = contentSectionIndices.max() else {
return
}
if lastVisibleRow.section < maxContentSectionIndex {
return