Skip to content

Commit 2e3595b

Browse files
committed
Added null reference check to RestClient constructor
1 parent 369c14d commit 2e3595b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

RestSharp/RestClient.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@ public RestClient(Uri baseUrl) : this()
7575
/// <param name="baseUrl"></param>
7676
public RestClient(string baseUrl) : this()
7777
{
78-
var uri = new Uri(baseUrl);
79-
BaseUrl = uri;
78+
if (String.IsNullOrEmpty(baseUrl))
79+
throw new ArgumentNullException("baseUrl");
80+
81+
BaseUrl = new Uri(baseUrl);
8082
}
8183

8284
private IDictionary<string, IDeserializer> ContentHandlers { get; set; }

0 commit comments

Comments
 (0)