From 6c70ed4b4e5a804aa0670d0d5fa9dbf1f58bd2d1 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sun, 2 Jun 2024 09:41:22 -0700 Subject: [PATCH] Fix crash in MultiColumnNavController due to closing already-removed VC Not sure how this is possible, but there was a report of it Closes #485 --- .../Screens/Utilities/MultiColumnNavigationController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tusker/Screens/Utilities/MultiColumnNavigationController.swift b/Tusker/Screens/Utilities/MultiColumnNavigationController.swift index e1537c8de7..48bf7e0839 100644 --- a/Tusker/Screens/Utilities/MultiColumnNavigationController.swift +++ b/Tusker/Screens/Utilities/MultiColumnNavigationController.swift @@ -142,8 +142,8 @@ class MultiColumnNavigationController: UIViewController { } fileprivate func closeColumn(_ vc: UIViewController) { - let index = viewControllers.firstIndex(of: vc)! - guard index > 0 else { + guard let index = viewControllers.firstIndex(of: vc), + index > 0 else { // Can't close the last column return }