From 37442bcb48367d2652611f6204752a072b286a10 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Mon, 15 May 2023 23:38:07 -0400 Subject: [PATCH] Fix crash if selected search scope somehow changes before the view is loaded --- Tusker/Screens/Search/SearchResultsViewController.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tusker/Screens/Search/SearchResultsViewController.swift b/Tusker/Screens/Search/SearchResultsViewController.swift index 6f4204af..63180cf7 100644 --- a/Tusker/Screens/Search/SearchResultsViewController.swift +++ b/Tusker/Screens/Search/SearchResultsViewController.swift @@ -180,6 +180,9 @@ class SearchResultsViewController: UIViewController, CollectionViewController { } func performSearch(query: String?) { + guard isViewLoaded else { + return + } guard let query = query, !query.isEmpty else { self.dataSource.apply(NSDiffableDataSourceSnapshot()) return