Skip to content

Commit

Permalink
Add array check for listRepoContents
Browse files Browse the repository at this point in the history
  • Loading branch information
PineappleIOnic committed Nov 2, 2023
1 parent d161d11 commit 9c6d1c3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
28 changes: 14 additions & 14 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/VCS/Adapter/Git/GitHub.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ public function listRepositoryContents(string $owner, string $repositoryName, st

$response = $this->call(self::METHOD_GET, $url, ['Authorization' => "Bearer $this->accessToken"]);

if (!is_array($response['body'])) {
return [];
}

return array_map(static function ($item) {
return $item['name'];
}, $response['body']);
Expand Down

0 comments on commit 9c6d1c3

Please sign in to comment.