Skip to content

Commit beeb0b8

Browse files
committed
Handle failure in fetching Zig version index
1 parent 9e2a5ce commit beeb0b8

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/Package/Artifact/zig.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ public function downBinary(ArtifactDownloader $downloader): DownloadResult
2626
$index_json = default_shell()->executeCurl('https://ziglang.org/download/index.json', retries: $downloader->getRetry());
2727
$index_json = json_decode($index_json ?: '', true);
2828
$latest_version = null;
29+
if ($index_json === null) {
30+
throw new DownloaderException('Failed to fetch Zig version index');
31+
}
2932
foreach ($index_json as $version => $data) {
3033
if ($version !== 'master') {
3134
$latest_version = $version;

0 commit comments

Comments
 (0)