diff --git a/src/Microsoft.AspNetCore.Http.Abstractions/HostString.cs b/src/Microsoft.AspNetCore.Http.Abstractions/HostString.cs index 9496b26b..7851659b 100644 --- a/src/Microsoft.AspNetCore.Http.Abstractions/HostString.cs +++ b/src/Microsoft.AspNetCore.Http.Abstractions/HostString.cs @@ -35,7 +35,12 @@ public HostString(string value) /// A positive, greater than 0 value representing the port in the host string. 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); }