Skip to content

Commit cbf2f4c

Browse files
committed
Merge pull request #301 from Haacked/patch-2
Avoid potential NullReferenceException
2 parents 4059ae6 + 2d23330 commit cbf2f4c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

RestSharp/RestClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ public string BaseUrl
270270
set
271271
{
272272
_baseUrl = value;
273-
if (_baseUrl.EndsWith("/"))
273+
if (_baseUrl != null && _baseUrl.EndsWith("/"))
274274
{
275275
_baseUrl = _baseUrl.Substring(0, _baseUrl.Length - 1);
276276
}

0 commit comments

Comments
 (0)