Skip to content

Commit

Permalink
dismiss presented controller when parent is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
dazy1030 committed Aug 27, 2024
1 parent d02f2c7 commit d0fbb01
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/UIKitNavigation/Navigation/Presentation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,8 @@
// deinit alongside it on the main thread. If we use this other places we should force it
// to be a UIViewController as well, to ensure this functionality.
MainActor._assumeIsolated {
self.controller?.dismiss(animated: false)
guard let controller, controller.parent == nil else { return }
controller.dismiss(animated: false)
}
}
init(_ controller: UIViewController, id presentationID: AnyHashable? = nil) {
Expand Down

0 comments on commit d0fbb01

Please sign in to comment.