Fixing NRE with logging
This commit is contained in:
parent
fea30a4096
commit
d3ef91ea91
|
|
@ -75,7 +75,7 @@ namespace Microsoft.AspNet.Mvc.Logging
|
||||||
|
|
||||||
private string Formatter(ActionDescriptor descriptor)
|
private string Formatter(ActionDescriptor descriptor)
|
||||||
{
|
{
|
||||||
return descriptor?.DisplayName ?? "No action selected";
|
return descriptor != null ? descriptor.DisplayName : "No action selected";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -57,7 +57,8 @@ namespace Microsoft.AspNet.Mvc
|
||||||
Assert.Empty(values.ActionsMatchingRouteConstraints);
|
Assert.Empty(values.ActionsMatchingRouteConstraints);
|
||||||
Assert.Empty(values.ActionsMatchingActionConstraints);
|
Assert.Empty(values.ActionsMatchingActionConstraints);
|
||||||
Assert.Empty(values.FinalMatches);
|
Assert.Empty(values.FinalMatches);
|
||||||
Assert.Null(values.SelectedAction);
|
Assert.Null(values.SelectedAction);
|
||||||
|
Assert.DoesNotThrow(() => values.Summary);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|
@ -160,6 +161,7 @@ namespace Microsoft.AspNet.Mvc
|
||||||
Assert.Equal<ActionDescriptor>(actions, values.ActionsMatchingActionConstraints);
|
Assert.Equal<ActionDescriptor>(actions, values.ActionsMatchingActionConstraints);
|
||||||
Assert.Equal<ActionDescriptor>(actions, values.FinalMatches);
|
Assert.Equal<ActionDescriptor>(actions, values.FinalMatches);
|
||||||
Assert.Null(values.SelectedAction);
|
Assert.Null(values.SelectedAction);
|
||||||
|
Assert.DoesNotThrow(() => values.Summary);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue