Added null check in KestrelServerInformation

This commit is contained in:
Kristian Hellang 2015-12-08 10:58:42 +01:00
parent 90ece575f7
commit 6fbc3b8832
2 changed files with 11 additions and 0 deletions

View File

@ -14,6 +14,11 @@ namespace Microsoft.AspNet.Server.Kestrel
{
public KestrelServerInformation(IConfiguration configuration)
{
if (configuration == null)
{
throw new ArgumentNullException(nameof(configuration));
}
Addresses = GetAddresses(configuration);
ThreadCount = GetThreadCount(configuration);
NoDelay = GetNoDelay(configuration);

View File

@ -11,6 +11,12 @@ namespace Microsoft.AspNet.Server.KestrelTests
{
public class KestrelServerInformationTests
{
[Fact]
public void NullConfigurationThrows()
{
Assert.Throws<ArgumentNullException>(() => new KestrelServerInformation(null));
}
[Fact]
public void SetThreadCountUsingConfiguration()
{