Merge pull request #39 from MeekLogic/master

Fixed checkError index out of range
This commit is contained in:
Junade
2017-11-27 16:50:05 +08:00
committed by GitHub

View File

@@ -121,11 +121,11 @@ class Guzzle implements Adapter
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.');
}
}