JsonRPC4NET: TODO, what if HttpContent or HttpResponseMessage is null?
authorgu.martinm@gmail.com <gu.martinm@gmail.com>
Mon, 26 May 2014 15:09:39 +0000 (17:09 +0200)
committergu.martinm@gmail.com <gu.martinm@gmail.com>
Mon, 26 May 2014 15:09:39 +0000 (17:09 +0200)
jsonrpc4net/jsonrpc4net/JsonRpcHttpAsyncClient.cs

index 8864290..fc93ee3 100644 (file)
@@ -113,10 +113,12 @@ namespace GumartinM.JsonRPC4NET
             using (HttpClient client = new HttpClient { Timeout = TimeSpan.FromSeconds(5) })
             using (HttpContent contentPOST = new StringContent(jsonData, System.Text.Encoding.UTF8, "application/json-rpc"))
             using (HttpResponseMessage response = await client.PostAsync(uri, contentPOST, cancellation))
+            //TODO: What if response is null? :(
             using (HttpContent contentRESULT = response.Content)
             {
                 if (response.StatusCode == HttpStatusCode.OK)
                 {
+                    //TODO: What if contentRESULT is null? :(
                     return await this.ReadResponseAsync<TResult>(contentRESULT);
                 }