diff --git a/Tusker/Screens/Timeline/TimelineViewController.swift b/Tusker/Screens/Timeline/TimelineViewController.swift index dc418ecb..17e10b66 100644 --- a/Tusker/Screens/Timeline/TimelineViewController.swift +++ b/Tusker/Screens/Timeline/TimelineViewController.swift @@ -719,7 +719,11 @@ class TimelineViewController: UIViewController, TimelineLikeCollectionViewContro // there is no existing gap applySnapshotBeforeScrolling = true } - snapshot.insertItems([.gap], beforeItem: currentItems.first!) + if let first = currentItems.first { + snapshot.insertItems([.gap], beforeItem: first) + } else { + snapshot.appendItems([.gap], toSection: .statuses) + } snapshot.insertItems(presentItems.map { .status(id: $0, collapseState: .unknown, filterState: .unknown) }, beforeItem: .gap) if applySnapshotBeforeScrolling {