Skip to content

Commit

Permalink
Merge pull request #21 from johnpez/error-response-body-fix
Browse files Browse the repository at this point in the history
Fix for error when $errorResponse['body'] cannot be encoded
  • Loading branch information
Nightbr authored Dec 5, 2018
2 parents 0cfe337 + 10455d8 commit b12e65c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Subscriber/ListRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ public function getWebhooks($listId)
private function throwMailchimpError(array $errorResponse)
{
$errorArray = json_decode($errorResponse['body'], true);
if (array_key_exists('errors', $errorArray)) {
if (is_array($errorArray) && array_key_exists('errors', $errorArray)) {
throw new MailchimpException(
$errorArray['status'],
$errorArray['detail'],
Expand Down

0 comments on commit b12e65c

Please sign in to comment.