Skip to content

Commit 8a3f154

Browse files
committed
Handle case of GitHub returning 204 No Content in some scenarios which breaks ResultPager because no array is returned (it's an empty string) - issue ResultPager::get() can return string #1091
1 parent 4fca25f commit 8a3f154

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/Github/ResultPager.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ public function fetch(AbstractApi $api, string $method, array $parameters = []):
8686
$api = $closure($api);
8787
$result = $api->$method(...$parameters);
8888

89+
if ($result === "" && $this->client->getLastResponse()->getStatusCode() === 204) {
90+
$result = [];
91+
}
92+
8993
$this->postFetch(true);
9094

9195
return $result;

0 commit comments

Comments
 (0)