summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrojaro <>2010-05-31 12:20:59 +0000
committerrojaro <>2010-05-31 12:20:59 +0000
commitfd207518a68243c4d2802177a63567644fd4a620 (patch)
tree40f30b57bec43141fd0b4446940d63d7357b2155
parent0802beaf640fd56965ae87c606cd964e61c18f51 (diff)
TRpcClient now throws a TRpcClientResponseException if the response to a request is empty
-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))