diff --git a/src/Microsoft.AspNet.Mvc.Core/Logging/DefaultActionSelectorSelectAsyncValues.cs b/src/Microsoft.AspNet.Mvc.Core/Logging/DefaultActionSelectorSelectAsyncValues.cs index 084e4ac875..e5f85b3202 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Logging/DefaultActionSelectorSelectAsyncValues.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Logging/DefaultActionSelectorSelectAsyncValues.cs @@ -75,7 +75,7 @@ namespace Microsoft.AspNet.Mvc.Logging private string Formatter(ActionDescriptor descriptor) { - return descriptor?.DisplayName ?? "No action selected"; + return descriptor != null ? descriptor.DisplayName : "No action selected"; } } } \ No newline at end of file diff --git a/test/Microsoft.AspNet.Mvc.Core.Test/DefaultActionSelectorTests.cs b/test/Microsoft.AspNet.Mvc.Core.Test/DefaultActionSelectorTests.cs index ba9c98d066..5c125d8403 100644 --- a/test/Microsoft.AspNet.Mvc.Core.Test/DefaultActionSelectorTests.cs +++ b/test/Microsoft.AspNet.Mvc.Core.Test/DefaultActionSelectorTests.cs @@ -57,7 +57,8 @@ namespace Microsoft.AspNet.Mvc Assert.Empty(values.ActionsMatchingRouteConstraints); Assert.Empty(values.ActionsMatchingActionConstraints); Assert.Empty(values.FinalMatches); - Assert.Null(values.SelectedAction); + Assert.Null(values.SelectedAction); + Assert.DoesNotThrow(() => values.Summary); } [Fact] @@ -160,6 +161,7 @@ namespace Microsoft.AspNet.Mvc Assert.Equal(actions, values.ActionsMatchingActionConstraints); Assert.Equal(actions, values.FinalMatches); Assert.Null(values.SelectedAction); + Assert.DoesNotThrow(() => values.Summary); } [Fact]