Prevent KeyNotFound when logging
This commit is contained in:
parent
4e97bfe957
commit
f35deb71f9
|
|
@ -695,7 +695,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
||||||
stringBuilder.Append($"{routeKeys[i]} = \"{routeValues[i]}\", ");
|
stringBuilder.Append($"{routeKeys[i]} = \"{routeValues[i]}\", ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (action.RouteValues["page"] != null)
|
if (action.RouteValues.TryGetValue("page", out var page) && page != null)
|
||||||
{
|
{
|
||||||
_pageExecuting(logger, stringBuilder.ToString(), action.DisplayName, null);
|
_pageExecuting(logger, stringBuilder.ToString(), action.DisplayName, null);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue