Fix not checking if section exists before getting item identifiers

Closes #398
This commit is contained in:
Shadowfacts 2023-05-27 15:33:33 -07:00
parent f5f1be9f7d
commit bf6dfab121
1 changed files with 3 additions and 0 deletions

View File

@ -263,6 +263,9 @@ class NotificationsCollectionViewController: UIViewController, TimelineLikeColle
return return
} }
var snapshot = dataSource.snapshot() var snapshot = dataSource.snapshot()
guard snapshot.sectionIdentifiers.contains(.notifications) else {
return
}
let items = snapshot.itemIdentifiers(inSection: .notifications) let items = snapshot.itemIdentifiers(inSection: .notifications)
let toDelete = statusIDs.flatMap { id in let toDelete = statusIDs.flatMap { id in
items.lazy.filter { $0.group?.notifications.first?.status?.id == id } items.lazy.filter { $0.group?.notifications.first?.status?.id == id }