-
-
Couldn't load subscription status.
- Fork 2.3k
Closed
Labels
Description
I recently found a bug where a DELETE response object causes a null reference exception when the response meets the following:
- content-type: null
- body: null
- content-length: 0
This most likely affects all request types.
Looking through the source the issue appears to be line 624 in RestSharp/RestClient.cs where raw.ContentType is being accessed:
if (response.ErrorException == null) { IDeserializer handler = this.GetHandler(raw.ContentType);
There should either be a null check here, or the IRestResponse object raw should be passed into GetHandler() and the null check should be done there.