From 71428219389d5fe429c0bad0bd31b2cda55cdfce Mon Sep 17 00:00:00 2001 From: Błażej Kardyś Date: Mon, 20 Jan 2020 17:13:28 +0100 Subject: Adding changes to HTML UI render --- core/src/main/kotlin/resolvers/DefaultLocationProvider.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'core/src/main/kotlin/resolvers/DefaultLocationProvider.kt') diff --git a/core/src/main/kotlin/resolvers/DefaultLocationProvider.kt b/core/src/main/kotlin/resolvers/DefaultLocationProvider.kt index d7089f96..3412d975 100644 --- a/core/src/main/kotlin/resolvers/DefaultLocationProvider.kt +++ b/core/src/main/kotlin/resolvers/DefaultLocationProvider.kt @@ -38,6 +38,8 @@ open class DefaultLocationProvider( else -> ancestors(node.parent()) + node } + override fun top(): PageNode = pageGraphRoot + protected open fun findInPageGraph(dri: DRI, platforms: List): PageNode? = pageGraphRoot.dfs { it.dri == dri } @@ -52,7 +54,7 @@ open class DefaultLocationProvider( else -> getPath(pathNode.parent(), path + pathNode.pathName().ifEmpty { "root" }) } - val contextNode = if (context?.children?.isEmpty() == true) context.parent() else context + val contextNode = if (context?.children?.isEmpty() == true && context.parent() != null) context.parent() else context val nodePath = getPath(node).reversed() val contextPath = getPath(contextNode).reversed() -- cgit