From ba0926703028d5562786341ec2c6a20690e22d75 Mon Sep 17 00:00:00 2001 From: "gu.martinm@gmail.com" Date: Mon, 3 Mar 2014 01:21:43 +0100 Subject: [PATCH] jsonrpc4net mono: avoid null return value --- Mono/jsonrpc4net/jsonrpc4net/JsonRpcHttpAsyncClient.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Mono/jsonrpc4net/jsonrpc4net/JsonRpcHttpAsyncClient.cs b/Mono/jsonrpc4net/jsonrpc4net/JsonRpcHttpAsyncClient.cs index a2ad1dc..56469e0 100644 --- a/Mono/jsonrpc4net/jsonrpc4net/JsonRpcHttpAsyncClient.cs +++ b/Mono/jsonrpc4net/jsonrpc4net/JsonRpcHttpAsyncClient.cs @@ -97,8 +97,6 @@ namespace GumartinM.JsonRPC4Mono /// The 1st type parameter. private POSTResult ReadResponse(byte[] jsonBytes) { - POSTResult postResult = new POSTResult(); - string json = System.Text.Encoding.UTF8.GetString(jsonBytes); JObject jsonObjects = JObject.Parse(json); @@ -112,10 +110,10 @@ namespace GumartinM.JsonRPC4Mono if (jsonTokens.ContainsKey("result")) { - postResult = JsonConvert.DeserializeObject>(json, _jsonSettings); + return JsonConvert.DeserializeObject>(json, _jsonSettings); } - return postResult; + throw new JsonRpcClientException(0, "There is not neither error nor result in JSON response data.", jsonObjects); } /// -- 2.1.4