Skip to content

Commit

Permalink
Handle case of GitHub returning 204 No Content in some scenarios whic…
Browse files Browse the repository at this point in the history
…h breaks ResultPager because no array is returned (it's an empty string) - issue ResultPager::get() can return string #1091
  • Loading branch information
tomcorbett committed Mar 22, 2024
1 parent 4fca25f commit 8a3f154
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Github/ResultPager.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ public function fetch(AbstractApi $api, string $method, array $parameters = []):
$api = $closure($api);
$result = $api->$method(...$parameters);

if ($result === "" && $this->client->getLastResponse()->getStatusCode() === 204) {
$result = [];
}

$this->postFetch(true);

return $result;
Expand Down

0 comments on commit 8a3f154

Please sign in to comment.