Skip to content

Commit 99d89e7

Browse files
authored
Merge pull request #39 from MeekLogic/master
Fixed checkError index out of range
2 parents d00a1d3 + 55e81fe commit 99d89e7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Adapter/Guzzle.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ private function checkError(ResponseInterface $response)
121121
throw new JSONException();
122122
}
123123

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

128-
if (isset($json->success) && ($json->success === false)) {
128+
if (isset($json->success) && !$json->success) {
129129
throw new ResponseException('Request was unsuccessful.');
130130
}
131131
}

0 commit comments

Comments
 (0)