We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 93f489d commit 5dd9848Copy full SHA for 5dd9848
1 file changed
src/WebExpress.WebCore/WebSitemap/SitemapManager.cs
@@ -193,8 +193,13 @@ public IUri GetUri<TEnpoint>(IEndpointContext endpointContext)
193
.Where(x => x.EndpointId.Equals(endpointContext.EndpointId));
194
195
var node = _root.GetPreOrder()
196
- .Where(x => endpointContexts.Contains(x.EndpointContext))
197
- .FirstOrDefault();
+ .FirstOrDefault(x => endpointContexts.Contains(x.EndpointContext));
+
198
+ if (node is null)
199
+ {
200
+ // fallback to the search by application context
201
+ return GetUri<TEnpoint>(endpointContext.ApplicationContext);
202
+ }
203
204
return new UriEndpoint(_serverUri, node?.EndpointContext?.Route.PathSegments, null);
205
}
0 commit comments