From 9d0e5f2cc3dfbde6dd5cba07d522bfba914fbbdb Mon Sep 17 00:00:00 2001 From: Marc Michalsky forumZFD Date: Mon, 2 Nov 2020 17:52:48 +0100 Subject: [PATCH] bug fix: do not create empty event arrays --- CRM/TwingleCampaign/BAO/TwingleApiCall.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CRM/TwingleCampaign/BAO/TwingleApiCall.php b/CRM/TwingleCampaign/BAO/TwingleApiCall.php index 6f131c9..c46631b 100644 --- a/CRM/TwingleCampaign/BAO/TwingleApiCall.php +++ b/CRM/TwingleCampaign/BAO/TwingleApiCall.php @@ -171,7 +171,9 @@ class TwingleApiCall { $response = $this->curlGet($url, $params); $finished = is_null($eventId) || count($response['data']) < $this->limit; $offset = $offset + $this->limit; - $result = array_merge($result, $response['data']); + if ($response['data']) { + $result = array_merge($result, $response['data']); + } } return $result; }