diff --git a/src/Client.php b/src/Client.php index afdd9b3..c2ad242 100644 --- a/src/Client.php +++ b/src/Client.php @@ -308,10 +308,13 @@ public function getAccessToken($code = '') */ public static function responseToArray($response) { - return \GuzzleHttp\json_decode( - $response->getBody()->getContents(), - true - ); + if ($contents = $response->getBody()->getContents()) { + return \GuzzleHttp\json_decode( + $contents, + true + ); + } + return array(); } /**