Skip to content

Commit e9bff6a

Browse files
committed
Remove double cast when one will do
1 parent 272e6e9 commit e9bff6a

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)