From 496c5afe8e5ff47ef2a518b3ff41d56c63e5177c Mon Sep 17 00:00:00 2001 From: "Andreas.Degwerth" Date: Thu, 29 Dec 2022 11:36:55 +0100 Subject: [PATCH] fixed access to possible null object RequestMessage --- src/RestSharp/Response/RestResponse.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RestSharp/Response/RestResponse.cs b/src/RestSharp/Response/RestResponse.cs index cc7843b0b..289a7a609 100644 --- a/src/RestSharp/Response/RestResponse.cs +++ b/src/RestSharp/Response/RestResponse.cs @@ -90,7 +90,7 @@ async Task GetDefaultResponse() { ContentType = httpResponse.Content.Headers.ContentType?.MediaType, ResponseStatus = calculateResponseStatus(httpResponse), ErrorException = httpResponse.MaybeException(), - ResponseUri = httpResponse.RequestMessage!.RequestUri, + ResponseUri = httpResponse.RequestMessage?.RequestUri, Server = httpResponse.Headers.Server.ToString(), StatusCode = httpResponse.StatusCode, StatusDescription = httpResponse.ReasonPhrase,