diff --git a/enro-core/src/main/java/dev/enro/core/container/DefaultContainerExecutor.kt b/enro-core/src/main/java/dev/enro/core/container/DefaultContainerExecutor.kt index 0f033be1..03fd027a 100644 --- a/enro-core/src/main/java/dev/enro/core/container/DefaultContainerExecutor.kt +++ b/enro-core/src/main/java/dev/enro/core/container/DefaultContainerExecutor.kt @@ -121,17 +121,22 @@ internal object DefaultContainerExecutor : NavigationExecutor, ): List { - var activeContainer = activeContainer val result = mutableListOf() + activeContainer?.let { result.add(it) } + + var activeContainer = activeContainer?.childContext?.containerManager?.activeContainer while (activeContainer != null) { + result.add(activeContainer) if (exclude.contains(activeContainer.key.name)) { break } - result.add(activeContainer) activeContainer = activeContainer.childContext?.containerManager?.activeContainer } return result