diff --git a/Sources/UIKitNavigation/Navigation/NavigationStackController.swift b/Sources/UIKitNavigation/Navigation/NavigationStackController.swift index 54cc23f48..75a997f4d 100644 --- a/Sources/UIKitNavigation/Navigation/NavigationStackController.swift +++ b/Sources/UIKitNavigation/Navigation/NavigationStackController.swift @@ -148,7 +148,9 @@ invalidIndices.insert(index) } } - path.remove(atOffsets: invalidIndices) + if !invalidIndices.isEmpty { + path.remove(atOffsets: invalidIndices) + } setViewControllers(newViewControllers, animated: !transaction.uiKit.disablesAnimations) } }