From b55a96d6492937a3c561e4bd62ebaa08451a13fe Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sun, 30 Aug 2020 19:57:32 -0400 Subject: [PATCH] Fix crash when resizing split view on iPad if Explore search controller hadn't been created yet --- Tusker/Screens/Main/MainSplitViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tusker/Screens/Main/MainSplitViewController.swift b/Tusker/Screens/Main/MainSplitViewController.swift index fba38a14..3d2071c8 100644 --- a/Tusker/Screens/Main/MainSplitViewController.swift +++ b/Tusker/Screens/Main/MainSplitViewController.swift @@ -217,7 +217,7 @@ extension MainSplitViewController: UISplitViewControllerDelegate { // If the tab navigation stack has only one item or the search controller is active, it corresponds to the Search item // For other items, the 2nd VC in the nav stack determines which sidebar item they map to. // Search screen has special considerations, all others can be transferred directly. - if tabNavigationStack.count == 1 || ((tabNavigationStack.first as? ExploreViewController)?.searchController.isActive ?? false) { + if tabNavigationStack.count == 1 || ((tabNavigationStack.first as? ExploreViewController)?.searchController?.isActive ?? false) { exploreItem = .search let searchVC = SearchViewController(mastodonController: mastodonController) searchVC.loadViewIfNeeded()