Fix potential crash when trying to save timeline state

This commit is contained in:
Shadowfacts 2022-11-24 12:14:19 -05:00
parent 366834e2e4
commit 23f9e200dc
1 changed files with 3 additions and 0 deletions

View File

@ -184,6 +184,9 @@ class TimelineViewController: UIViewController, TimelineLikeCollectionViewContro
} }
func stateRestorationActivity() -> NSUserActivity? { func stateRestorationActivity() -> NSUserActivity? {
guard isViewLoaded else {
return nil
}
let visible = collectionView.indexPathsForVisibleItems.sorted() let visible = collectionView.indexPathsForVisibleItems.sorted()
let snapshot = dataSource.snapshot() let snapshot = dataSource.snapshot()
let visibleRect = CGRect(origin: collectionView.contentOffset, size: collectionView.bounds.size) let visibleRect = CGRect(origin: collectionView.contentOffset, size: collectionView.bounds.size)