Fix potential crash when collapsing w/o selected sidebar item

This commit is contained in:
Shadowfacts 2021-04-25 12:39:45 -04:00
parent c737354ed3
commit daa1a9eef7
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 4 additions and 1 deletions

View File

@ -164,7 +164,10 @@ extension MainSplitViewController: UISplitViewControllerDelegate {
}
// Switch the tab bar to focus the same item as the sidebar has selected
switch sidebar.selectedItem! {
switch sidebar.selectedItem {
case nil:
break
case let .tab(tab):
// sidebar items that map 1 <-> 1 can be transferred directly
tabBarViewController.select(tab: tab)