diff --git a/Tusker/Screens/Timeline/TimelineViewController.swift b/Tusker/Screens/Timeline/TimelineViewController.swift index ccc872d1..b40c2076 100644 --- a/Tusker/Screens/Timeline/TimelineViewController.swift +++ b/Tusker/Screens/Timeline/TimelineViewController.swift @@ -175,6 +175,9 @@ class TimelineViewController: UIViewController, TimelineLikeCollectionViewContro return } var snapshot = dataSource.snapshot() + guard snapshot.indexOfSection(.statuses) != nil else { + return + } let items = snapshot.itemIdentifiers(inSection: .statuses) let pageSize = 20 let numberOfPagesToPrune = (items.count - lastVisibleIndexPath.row - 1) / pageSize