Skip to content

Commit

Permalink
Handles responses with no meta
Browse files Browse the repository at this point in the history
  • Loading branch information
Gman98ish committed Dec 5, 2022
1 parent 9214bb0 commit eec7913
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public function getAsync($path, $params = [], $headers = [])
$raw = json_decode($response->getBody()->getContents());

if (is_array($raw->data)) {
return new Page($raw->data, $raw->meta);
$meta = isset($raw->meta) ? $raw->meta : null;
return new Page($raw->data, $meta);
}

return new Entity($raw->data);
Expand Down

0 comments on commit eec7913

Please sign in to comment.