Skip to content

Commit b12e65c

Browse files
authored
Merge pull request #21 from johnpez/error-response-body-fix
Fix for error when $errorResponse['body'] cannot be encoded
2 parents 0cfe337 + 10455d8 commit b12e65c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Subscriber/ListRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ public function getWebhooks($listId)
514514
private function throwMailchimpError(array $errorResponse)
515515
{
516516
$errorArray = json_decode($errorResponse['body'], true);
517-
if (array_key_exists('errors', $errorArray)) {
517+
if (is_array($errorArray) && array_key_exists('errors', $errorArray)) {
518518
throw new MailchimpException(
519519
$errorArray['status'],
520520
$errorArray['detail'],

0 commit comments

Comments
 (0)