Skip to content

Commit b8e3ad2

Browse files
Merge pull request #1421 from Phyxion/patch-1
Fixing comment in #1280
2 parents d0e51a2 + 6650f38 commit b8e3ad2

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
@@ -565,7 +565,8 @@ IRestResponse<T> Deserialize<T>(IRestRequest request, IRestResponse raw)
565565
// be deserialized
566566
if (response.ErrorException == null)
567567
{
568-
var handler = GetHandler(raw.ContentType)();
568+
var func = GetHandler(raw.ContentType);
569+
var handler = func?.Invoke();
569570

570571
// Only continue if there is a handler defined else there is no way to deserialize the data.
571572
// This can happen when a request returns for example a 404 page instead of the requested JSON/XML resource
@@ -635,4 +636,4 @@ public UrlSegmentParamsValues(Uri builderUri, string assembled)
635636
public string Resource { get; }
636637
}
637638
}
638-
}
639+
}

0 commit comments

Comments
 (0)