Skip to content

Commit

Permalink
Fix:ControllerLinkGeneratorExtensions.GetAmbientValues throws NullRef…
Browse files Browse the repository at this point in the history
…erenceException (dotnet#24576)

- related issue dotnet#24412
- add null check on GetAmbientValues(HttpContext)
  • Loading branch information
wu-yafeng authored Aug 5, 2020
1 parent f058274 commit 7487988
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ private static RouteValuesAddress CreateAddress(HttpContext httpContext, string

private static RouteValueDictionary GetAmbientValues(HttpContext httpContext)
{
return httpContext?.Features.Get<IRouteValuesFeature>()?.RouteValues;
return httpContext?.Features?.Get<IRouteValuesFeature>()?.RouteValues;
}
}
}

0 comments on commit 7487988

Please sign in to comment.