From fd207518a68243c4d2802177a63567644fd4a620 Mon Sep 17 00:00:00 2001 From: rojaro <> Date: Mon, 31 May 2010 12:20:59 +0000 Subject: TRpcClient now throws a TRpcClientResponseException if the response to a request is empty --- framework/Util/TRpcClient.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'framework/Util') diff --git a/framework/Util/TRpcClient.php b/framework/Util/TRpcClient.php index 867c68d2..964d71a2 100644 --- a/framework/Util/TRpcClient.php +++ b/framework/Util/TRpcClient.php @@ -247,7 +247,8 @@ class TJsonRpcClient extends TRpcClient return true; // decode response - $_response = json_decode($_response, true); + if(($_response = json_decode($_response, true)) === null) + throw new TRpcClientResponseException('Empty response received'); // handle error response if(!is_null($_response['error'])) @@ -324,7 +325,8 @@ class TXmlRpcClient extends TRpcClient return true; // decode response - $_response = xmlrpc_decode($_response); + if(($_response = xmlrpc_decode($_response)) === null) + throw new TRpcClientResponseException('Empty response received'); // handle error response if(xmlrpc_is_fault($_response)) -- cgit v1.2.3