Skip to content

Commit

Permalink
Adjusted Timeout setter to throw an out of range exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
basicn86 committed Jul 4, 2023
1 parent fdf342b commit 6c89e3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/HtmlAgilityPack.Shared/HtmlWeb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -803,12 +803,12 @@ internal static HttpClient GetSharedHttpClient(string userAgent)
public DecompressionMethods AutomaticDecompression { get; set; }

/// <summary>
/// Gets or sets the timeout value in milliseconds.
/// Gets or sets the timeout value in milliseconds. Must be greater than zero.
/// </summary>
public int Timeout
{
get { return _timeout; }
set { if (value < 0) { _timeout = 0; } else { _timeout = value; } }
set { if (value <= 0) { throw new ArgumentOutOfRangeException(); } else { _timeout = value; } }
}

/// <summary>
Expand Down

0 comments on commit 6c89e3f

Please sign in to comment.