From 948eff1f7e398f0659f263d4cb55c3d866d803f8 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Tue, 29 Nov 2022 23:19:19 -0500 Subject: [PATCH] Workaround for crash when pressing Cmd+1/2/... on macOS See #253 The actions won't work, but it's better than crashing :/ --- Tusker/Screens/Main/MainSplitViewController.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Tusker/Screens/Main/MainSplitViewController.swift b/Tusker/Screens/Main/MainSplitViewController.swift index 54f95580d6..2d6bd51244 100644 --- a/Tusker/Screens/Main/MainSplitViewController.swift +++ b/Tusker/Screens/Main/MainSplitViewController.swift @@ -101,7 +101,11 @@ class MainSplitViewController: UISplitViewController { } } - @objc func handleSidebarItemCommand(_ command: UICommand) { + @objc func handleSidebarItemCommand(_ sender: AnyObject) { + // workaround for crash when sender is not a UICommand, see #253 and FB11804009 + guard let command = sender as? UICommand else { + return + } let item: MainSidebarViewController.Item if let index = command.propertyList as? Int { item = .tab(MainTabBarViewController.Tab(rawValue: index)!)