From bf6dfab1218205d70cc311d6167197cd4cfba1f7 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sat, 27 May 2023 15:33:33 -0700 Subject: [PATCH] Fix not checking if section exists before getting item identifiers Closes #398 --- .../Notifications/NotificationsCollectionViewController.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tusker/Screens/Notifications/NotificationsCollectionViewController.swift b/Tusker/Screens/Notifications/NotificationsCollectionViewController.swift index 55630544..de95da97 100644 --- a/Tusker/Screens/Notifications/NotificationsCollectionViewController.swift +++ b/Tusker/Screens/Notifications/NotificationsCollectionViewController.swift @@ -263,6 +263,9 @@ class NotificationsCollectionViewController: UIViewController, TimelineLikeColle return } var snapshot = dataSource.snapshot() + guard snapshot.sectionIdentifiers.contains(.notifications) else { + return + } let items = snapshot.itemIdentifiers(inSection: .notifications) let toDelete = statusIDs.flatMap { id in items.lazy.filter { $0.group?.notifications.first?.status?.id == id }