Throw exception if ThreadCount negative
This commit is contained in:
parent
887cf2c7be
commit
dda5774a8b
|
|
@ -55,7 +55,14 @@ namespace Microsoft.AspNet.Server.Kestrel
|
||||||
|
|
||||||
disposables.Push(engine);
|
disposables.Push(engine);
|
||||||
|
|
||||||
engine.Start(information.ThreadCount <= 0 ? 1 : information.ThreadCount);
|
if (information.ThreadCount < 0)
|
||||||
|
{
|
||||||
|
throw new ArgumentOutOfRangeException(nameof(information.ThreadCount),
|
||||||
|
information.ThreadCount,
|
||||||
|
"ThreadCount cannot be negative");
|
||||||
|
}
|
||||||
|
|
||||||
|
engine.Start(information.ThreadCount == 0 ? 1 : information.ThreadCount);
|
||||||
|
|
||||||
foreach (var address in information.Addresses)
|
foreach (var address in information.Addresses)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue