From 99bc4d57828774f28222990b803d3260300931fb Mon Sep 17 00:00:00 2001 From: Peter Date: Tue, 11 Sep 2018 22:19:36 +0300 Subject: [PATCH] no message --- Display/NavigationController.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Display/NavigationController.swift b/Display/NavigationController.swift index ea304a4319..40c0848d8c 100644 --- a/Display/NavigationController.swift +++ b/Display/NavigationController.swift @@ -816,6 +816,9 @@ open class NavigationController: UINavigationController, ContainableController, var poppedControllers: [UIViewController] = [] var found = false var controllers = self.viewControllers + if !controllers.contains(where: { $0 === viewController }) { + return nil + } while !controllers.isEmpty { if controllers[controllers.count - 1] === viewController { found = true