diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2019-12-09 16:39:49 +0100 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2019-12-10 11:14:56 +0100 |
| commit | 9d76e6a4e406658b1f06bb6828582ed54af54232 (patch) | |
| tree | a5379816c69f649de8e0d0372b9ac30712eec6a8 | |
| parent | 6bf60530d3eae96f6ed30607b14638d9d4c76d95 (diff) | |
| download | mullvadvpn-9d76e6a4e406658b1f06bb6828582ed54af54232.tar.xz mullvadvpn-9d76e6a4e406658b1f06bb6828582ed54af54232.zip | |
Filter attempts to unwind to exactly the same controller
| -rw-r--r-- | ios/MullvadVPN/RootContainerViewController.swift | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ios/MullvadVPN/RootContainerViewController.swift b/ios/MullvadVPN/RootContainerViewController.swift index 7d1990e507..f75c3b94de 100644 --- a/ios/MullvadVPN/RootContainerViewController.swift +++ b/ios/MullvadVPN/RootContainerViewController.swift @@ -114,6 +114,9 @@ class RootContainerViewController: UIViewController { // MARK: - Storyboard segue handling override func unwind(for unwindSegue: UIStoryboardSegue, towards subsequentVC: UIViewController) { + // Make sure there is no attempt to unwind to the top view controller + guard subsequentVC != topViewController else { return } + let index = viewControllers.firstIndex(of: subsequentVC)! let newViewControllers = Array(viewControllers.prefix(through: index)) |
