From 55e81fe02c22e6d51f0ada4d1f94755b9c7e85c7 Mon Sep 17 00:00:00 2001 From: Tyler Vigario Date: Sun, 26 Nov 2017 19:23:31 -0800 Subject: [PATCH] Fixed checkError index out of range --- src/Adapter/Guzzle.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Adapter/Guzzle.php b/src/Adapter/Guzzle.php index b3bb327..7b279b9 100644 --- a/src/Adapter/Guzzle.php +++ b/src/Adapter/Guzzle.php @@ -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.'); } }