bug fix: do not create empty event arrays

This commit is contained in:
Marc Michalsky forumZFD 2020-11-02 17:52:48 +01:00
parent 23977c122e
commit 9d0e5f2cc3
Signed by untrusted user who does not match committer: marc.koch
GPG key ID: 12406554CFB028B9

View file

@ -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;
}