More keynotfound avoidance

This commit is contained in:
Pranav K 2018-05-07 11:08:41 -07:00
parent f35deb71f9
commit dfd9b17f68
No known key found for this signature in database
GPG Key ID: 1963DA6D96C3057A
1 changed files with 1 additions and 1 deletions

View File

@ -784,7 +784,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
// Don't log if logging wasn't enabled at start of request as time will be wildly wrong.
if (logger.IsEnabled(LogLevel.Information))
{
if (action.RouteValues["page"] != null)
if (action.RouteValues.TryGetValue("page", out var page) && page != null)
{
_pageExecuted(logger, action.DisplayName, timeSpan.TotalMilliseconds, null);
}