Fix crash when refreshing before anything is loaded

This commit is contained in:
Shadowfacts 2021-08-08 10:26:51 -04:00
parent 340d13b1fa
commit 1d79918a94
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 2 additions and 1 deletions

View File

@ -188,7 +188,8 @@ class DiffableTimelineLikeTableViewController<Section: Hashable & CaseIterable,
var item: Item? = nil
for section in timelineContentSections() {
if let first = snapshot.itemIdentifiers(inSection: section).first {
if snapshot.indexOfSection(section) != nil,
let first = snapshot.itemIdentifiers(inSection: section).first {
item = first
break
}