Skip to content

Commit

Permalink
Merge pull request #39 from MeekLogic/master
Browse files Browse the repository at this point in the history
Fixed checkError index out of range
  • Loading branch information
IcyApril authored Nov 27, 2017
2 parents d00a1d3 + 55e81fe commit 99d89e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Adapter/Guzzle.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ private function checkError(ResponseInterface $response)
throw new JSONException();
}

if (isset($json->errors)) {
if (isset($json->errors) && count($json->errors) >= 1) {
throw new ResponseException($json->errors[0]->message, $json->errors[0]->code);
}

if (isset($json->success) && ($json->success === false)) {
if (isset($json->success) && !$json->success) {
throw new ResponseException('Request was unsuccessful.');
}
}
Expand Down

0 comments on commit 99d89e7

Please sign in to comment.