Skip to content

Commit

Permalink
Fix for throwMailchimpError resulting in php error when $errorRespons…
Browse files Browse the repository at this point in the history
…e['body'] cannot be encoded
  • Loading branch information
vood002 committed Dec 5, 2018
1 parent 0cfe337 commit 10455d8
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 10455d8

Please sign in to comment.