Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/RestSharp/RestClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,8 @@ IRestResponse<T> Deserialize<T>(IRestRequest request, IRestResponse raw)
// be deserialized
if (response.ErrorException == null)
{
var handler = GetHandler(raw.ContentType)();
var func = GetHandler(raw.ContentType);
var handler = func?.Invoke();

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