diff --git a/src/Subscriber/ListRepository.php b/src/Subscriber/ListRepository.php index eff3b59..f092ac4 100644 --- a/src/Subscriber/ListRepository.php +++ b/src/Subscriber/ListRepository.php @@ -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'],