From c972e91eca0c03df264738672fd6bfdc2faf95ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Gallego?= Date: Wed, 16 Apr 2014 12:37:00 +0200 Subject: [PATCH] Fix async --- CHANGELOG.md | 4 ++++ src/ZfrMailChimp/Client/Listener/ErrorHandlerListener.php | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee6adc3..3eb8a55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 2.0.3 + +* Return in Error handler if no response is set (which happens in case of async calls) + ## 2.0.2 * Fix wrong parameter type for get list merge vars [#13](https://github.com/zf-fr/zfr-mailchimp/pull/13) diff --git a/src/ZfrMailChimp/Client/Listener/ErrorHandlerListener.php b/src/ZfrMailChimp/Client/Listener/ErrorHandlerListener.php index 97d4722..3e087fb 100644 --- a/src/ZfrMailChimp/Client/Listener/ErrorHandlerListener.php +++ b/src/ZfrMailChimp/Client/Listener/ErrorHandlerListener.php @@ -141,8 +141,8 @@ public static function getSubscribedEvents() public function handleError(Event $event) { $response = $event['response']; - - if ($response->getStatusCode() === 200) { + + if (null === $response || $response->getStatusCode() === 200) { return; }