Fix crash if selected search scope somehow changes before the view is loaded

This commit is contained in:
Shadowfacts 2023-05-15 23:38:07 -04:00
parent a99072dd7c
commit 37442bcb48
1 changed files with 3 additions and 0 deletions

View File

@ -180,6 +180,9 @@ class SearchResultsViewController: UIViewController, CollectionViewController {
} }
func performSearch(query: String?) { func performSearch(query: String?) {
guard isViewLoaded else {
return
}
guard let query = query, !query.isEmpty else { guard let query = query, !query.isEmpty else {
self.dataSource.apply(NSDiffableDataSourceSnapshot<Section, Item>()) self.dataSource.apply(NSDiffableDataSourceSnapshot<Section, Item>())
return return