summaryrefslogtreecommitdiff
path: root/framework/Util/TRpcClient.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Util/TRpcClient.php')
-rw-r--r--framework/Util/TRpcClient.php6
1 files changed, 4 insertions, 2 deletions
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))