Merge branch 'release/2.2'

This commit is contained in:
Chris Ross (ASP.NET) 2018-10-10 14:35:57 -07:00
commit b2d53bd328
1 changed files with 6 additions and 1 deletions

View File

@ -35,7 +35,12 @@ namespace Microsoft.AspNetCore.Http
/// <param name="port">A positive, greater than 0 value representing the port in the host string.</param>
public HostString(string host, int port)
{
if(port <= 0)
if (host == null)
{
throw new ArgumentNullException(nameof(host));
}
if (port <= 0)
{
throw new ArgumentOutOfRangeException(nameof(port), Resources.Exception_PortMustBeGreaterThanZero);
}