Skip to content

Commit 6650f38

Browse files
authored
Fixing comment in #1280
1 parent ac875b1 commit 6650f38

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/RestSharp/RestClient.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,8 @@ IRestResponse<T> Deserialize<T>(IRestRequest request, IRestResponse raw)
673673
// be deserialized
674674
if (response.ErrorException == null)
675675
{
676-
var handler = GetHandler(raw.ContentType)();
676+
var func = GetHandler(raw.ContentType);
677+
var handler = func?.Invoke();
677678

678679
// Only continue if there is a handler defined else there is no way to deserialize the data.
679680
// This can happen when a request returns for example a 404 page instead of the requested JSON/XML resource
@@ -743,4 +744,4 @@ public UrlSegmentParamsValues(Uri builderUri, string assembled)
743744
public string Resource { get; }
744745
}
745746
}
746-
}
747+
}

0 commit comments

Comments
 (0)