Skip to content

Commit 5dd9848

Browse files
committed
feat: add dashboard control, general improvements and minor bugs
1 parent 93f489d commit 5dd9848

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/WebExpress.WebCore/WebSitemap/SitemapManager.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,13 @@ public IUri GetUri<TEnpoint>(IEndpointContext endpointContext)
193193
.Where(x => x.EndpointId.Equals(endpointContext.EndpointId));
194194

195195
var node = _root.GetPreOrder()
196-
.Where(x => endpointContexts.Contains(x.EndpointContext))
197-
.FirstOrDefault();
196+
.FirstOrDefault(x => endpointContexts.Contains(x.EndpointContext));
197+
198+
if (node is null)
199+
{
200+
// fallback to the search by application context
201+
return GetUri<TEnpoint>(endpointContext.ApplicationContext);
202+
}
198203

199204
return new UriEndpoint(_serverUri, node?.EndpointContext?.Route.PathSegments, null);
200205
}

0 commit comments

Comments
 (0)