Skip to content

Commit

Permalink
Client: fixed return value when no events are available
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Kurowski committed Nov 2, 2018
1 parent d0b3022 commit 47774ee
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,13 @@ public function getEvent($id, EventParameters $params = NULL)
public function getEvents(EventParameters $params = NULL)
{
$response = $this->processRequest($params !== NULL ? $params : new EventParameters());
return \array_map(Event::class . '::fromResponseData', $response->getData());
$data = $response->getData();

if ($data === NULL) {
return [];
}

return \array_map(Event::class . '::fromResponseData', $data);
}

/**
Expand Down

0 comments on commit 47774ee

Please sign in to comment.