diff --git a/Tusker/Screens/Main/MainSplitViewController.swift b/Tusker/Screens/Main/MainSplitViewController.swift index 5ce25b2e..fba38a14 100644 --- a/Tusker/Screens/Main/MainSplitViewController.swift +++ b/Tusker/Screens/Main/MainSplitViewController.swift @@ -98,6 +98,9 @@ extension MainSplitViewController: UISplitViewControllerDelegate { } func splitViewControllerDidCollapse(_ svc: UISplitViewController) { + // on iPhones, the sidebar VC is never loaded, but since this method is still called, we can't do anything + guard sidebar.isViewLoaded else { return } + // Transfer the nav stacks for all the sidebar items that map 1 <-> 1 with tabs for tab in [MainTabBarViewController.Tab.timelines, .notifications, .myProfile] { let tabNav = tabBarViewController.viewController(for: tab) as! UINavigationController