Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Commit f6e20a3

Browse files
JamesNKTratcher
authored andcommitted
HostString throws ArgumentNullException for null host (#1045)
1 parent 2368024 commit f6e20a3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Microsoft.AspNetCore.Http.Abstractions/HostString.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ public HostString(string value)
3535
/// <param name="port">A positive, greater than 0 value representing the port in the host string.</param>
3636
public HostString(string host, int port)
3737
{
38-
if(port <= 0)
38+
if (host == null)
39+
{
40+
throw new ArgumentNullException(nameof(host));
41+
}
42+
43+
if (port <= 0)
3944
{
4045
throw new ArgumentOutOfRangeException(nameof(port), Resources.Exception_PortMustBeGreaterThanZero);
4146
}

0 commit comments

Comments
 (0)