Skip to content

Commit

Permalink
Merge pull request #8 from andrecastelo/master
Browse files Browse the repository at this point in the history
$data in checkResponse is an array
  • Loading branch information
tpavlek committed Apr 17, 2016
2 parents 2e9ac69 + 6ce460f commit ab449eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Provider/BattleNet.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ protected function getDefaultScopes()
protected function checkResponse(ResponseInterface $response, $data)
{
if ($response->getStatusCode() != 200) {
$data = json_decode($data, true);
throw new IdentityProviderException($data['message'], $response->getStatusCode(), $data);
$data = (is_array($data)) ? $data : json_decode($data, true);
throw new IdentityProviderException($data['error_description'], $response->getStatusCode(), $data);
}
}
}

0 comments on commit ab449eb

Please sign in to comment.