diff --git a/src/Hyperwallet/Util/ApiClient.php b/src/Hyperwallet/Util/ApiClient.php index 8753d7f5..a21cbc35 100644 --- a/src/Hyperwallet/Util/ApiClient.php +++ b/src/Hyperwallet/Util/ApiClient.php @@ -176,7 +176,7 @@ private function doRequest($method, $url, array $urlParams, array $options) { throw new HyperwalletApiException($errorResponse, $e); } catch (BadResponseException $e) { $body = \GuzzleHttp\json_decode($e->getResponse()->getBody(), true); - if (is_null($body) || !$body->errors || empty($body->errors)) { + if (is_null($body) || !isset($body['errors']) || empty($body['errors'])) { $body = array('errors' => array( array( 'message' => 'Failed to get any error message from response',