Added null check in KestrelServerInformation
This commit is contained in:
parent
90ece575f7
commit
6fbc3b8832
|
|
@ -14,6 +14,11 @@ namespace Microsoft.AspNet.Server.Kestrel
|
||||||
{
|
{
|
||||||
public KestrelServerInformation(IConfiguration configuration)
|
public KestrelServerInformation(IConfiguration configuration)
|
||||||
{
|
{
|
||||||
|
if (configuration == null)
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException(nameof(configuration));
|
||||||
|
}
|
||||||
|
|
||||||
Addresses = GetAddresses(configuration);
|
Addresses = GetAddresses(configuration);
|
||||||
ThreadCount = GetThreadCount(configuration);
|
ThreadCount = GetThreadCount(configuration);
|
||||||
NoDelay = GetNoDelay(configuration);
|
NoDelay = GetNoDelay(configuration);
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,12 @@ namespace Microsoft.AspNet.Server.KestrelTests
|
||||||
{
|
{
|
||||||
public class KestrelServerInformationTests
|
public class KestrelServerInformationTests
|
||||||
{
|
{
|
||||||
|
[Fact]
|
||||||
|
public void NullConfigurationThrows()
|
||||||
|
{
|
||||||
|
Assert.Throws<ArgumentNullException>(() => new KestrelServerInformation(null));
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void SetThreadCountUsingConfiguration()
|
public void SetThreadCountUsingConfiguration()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue