Skip to content

Commit

Permalink
Handle empty response content
Browse files Browse the repository at this point in the history
  • Loading branch information
sprain authored Oct 16, 2024
1 parent e564de8 commit a3dbdf7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/ApiClient/Http/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ public function getStatusCode(): int

public function getContent(): array
{
if (!$this->content) {
return [];
}

return json_decode($this->content, true, 512, JSON_THROW_ON_ERROR);
}

Expand Down

0 comments on commit a3dbdf7

Please sign in to comment.