Skip to content

Commit a3c903b

Browse files
committed
Merge pull request restsharp#411 from restsharp/cleanup
Remove double cast when one will do
2 parents 272e6e9 + e9bff6a commit a3c903b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

RestSharp/Http.Async.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ private HttpWebRequest GetStyleMethodInternalAsync(string method, Action<HttpRes
118118
private HttpResponse CreateErrorResponse(Exception ex)
119119
{
120120
var response = new HttpResponse();
121-
if (ex is WebException && ((WebException)ex).Status == WebExceptionStatus.RequestCanceled)
121+
var webException = ex as WebException;
122+
if (webException != null && webException.Status == WebExceptionStatus.RequestCanceled)
122123
{
123124
response.ResponseStatus = _timeoutState.TimedOut ? ResponseStatus.TimedOut : ResponseStatus.Aborted;
124125
return response;

0 commit comments

Comments
 (0)