From: gu.martinm@gmail.com Date: Mon, 26 May 2014 15:09:39 +0000 (+0200) Subject: JsonRPC4NET: TODO, what if HttpContent or HttpResponseMessage is null? X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=dd0aa26f5e683929597407984fc44749dfd959bf;p=CSharpForFun%2F.git JsonRPC4NET: TODO, what if HttpContent or HttpResponseMessage is null? --- diff --git a/jsonrpc4net/jsonrpc4net/JsonRpcHttpAsyncClient.cs b/jsonrpc4net/jsonrpc4net/JsonRpcHttpAsyncClient.cs index 8864290..fc93ee3 100644 --- a/jsonrpc4net/jsonrpc4net/JsonRpcHttpAsyncClient.cs +++ b/jsonrpc4net/jsonrpc4net/JsonRpcHttpAsyncClient.cs @@ -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(contentRESULT); }