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
This commit is contained in:
Shadowfacts 2024-06-02 09:41:22 -07:00
parent e3c480131a
commit 6c70ed4b4e
1 changed files with 2 additions and 2 deletions

View File

@ -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
}