diff --git a/src/Package/Artifact/zig.php b/src/Package/Artifact/zig.php index b42eee3a..95520aa4 100644 --- a/src/Package/Artifact/zig.php +++ b/src/Package/Artifact/zig.php @@ -26,6 +26,9 @@ class zig $index_json = default_shell()->executeCurl('https://ziglang.org/download/index.json', retries: $downloader->getRetry()); $index_json = json_decode($index_json ?: '', true); $latest_version = null; + if ($index_json === null) { + throw new DownloaderException('Failed to fetch Zig version index'); + } foreach ($index_json as $version => $data) { if ($version !== 'master') { $latest_version = $version;