summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ios/MullvadVPN/RootContainerViewController.swift3
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))