Skip to content

Commit 1877327

Browse files
committed
Trying to fix the build error.
1 parent 73f0e07 commit 1877327

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Components/Endpoints/src/Rendering/EndpointHtmlRenderer.EventDispatch.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private Task ReturnErrorResponse(string detailedMessage)
7474
: Task.CompletedTask;
7575
}
7676

77-
public void SetNotFoundResponse()
77+
private void SetNotFoundResponse(object sender, EventArgs args)
7878
{
7979
_httpContext.Response.StatusCode = StatusCodes.Status404NotFound;
8080
}

src/Components/Endpoints/src/Rendering/EndpointHtmlRenderer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ internal async Task InitializeStandardComponentServicesAsync(
7979
var navigationManager = httpContext.RequestServices.GetRequiredService<NavigationManager>();
8080
((IHostEnvironmentNavigationManager)navigationManager)?.Initialize(GetContextBaseUri(httpContext.Request), GetFullUri(httpContext.Request));
8181

82-
navigationManager?.NotFoundEvent += (sender, args) =>
82+
if (navigationManager != null)
8383
{
84-
SetNotFoundResponse();
85-
};
84+
navigationManager.NotFoundEvent += SetNotFoundResponse;
85+
}
8686

8787
var authenticationStateProvider = httpContext.RequestServices.GetService<AuthenticationStateProvider>();
8888
if (authenticationStateProvider is IHostEnvironmentAuthenticationStateProvider hostEnvironmentAuthenticationStateProvider)

0 commit comments

Comments
 (0)