From 03d1cb809df15cfb5c4fb3f93cd0715abedbc78b Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Wed, 4 Dec 2024 10:43:19 -0500 Subject: [PATCH 1/2] return from exception caught, and add a null check for thoroughness --- src/code/V3ServerAPICalls.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/code/V3ServerAPICalls.cs b/src/code/V3ServerAPICalls.cs index 8f5297ecc..a72eb51f3 100644 --- a/src/code/V3ServerAPICalls.cs +++ b/src/code/V3ServerAPICalls.cs @@ -1622,9 +1622,11 @@ private HttpContent HttpRequestCallForContent(string requestUrlV3, out ErrorReco "HttpRequestCallForContentFailure", ErrorCategory.InvalidResult, this); + + return null; } - if (string.IsNullOrEmpty(content.ToString())) + if (content == null || string.IsNullOrEmpty(content.ToString())) { _cmdletPassedIn.WriteDebug("Response is empty"); } From eb8c3a5f0bd1cbaa77417e426c6b221ed1ae4687 Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Wed, 4 Dec 2024 16:16:38 -0500 Subject: [PATCH 2/2] Update src/code/V3ServerAPICalls.cs Co-authored-by: Aditya Patwardhan --- src/code/V3ServerAPICalls.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/code/V3ServerAPICalls.cs b/src/code/V3ServerAPICalls.cs index a72eb51f3..c184426a8 100644 --- a/src/code/V3ServerAPICalls.cs +++ b/src/code/V3ServerAPICalls.cs @@ -1626,7 +1626,7 @@ private HttpContent HttpRequestCallForContent(string requestUrlV3, out ErrorReco return null; } - if (content == null || string.IsNullOrEmpty(content.ToString())) + if (string.IsNullOrEmpty(content?.ToString())) { _cmdletPassedIn.WriteDebug("Response is empty"); }