From 52da2664a577bd3f17b97bdcc23f153b25afa892 Mon Sep 17 00:00:00 2001 From: mrFq1 <1xxbx0il0@mozmail.com> Date: Wed, 24 Apr 2024 11:35:46 +0800 Subject: [PATCH] misc: alphaAsset error --- ClashX/General/AlphaMetaDownloader.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ClashX/General/AlphaMetaDownloader.swift b/ClashX/General/AlphaMetaDownloader.swift index dff8ac6af..9e642ebc4 100644 --- a/ClashX/General/AlphaMetaDownloader.swift +++ b/ClashX/General/AlphaMetaDownloader.swift @@ -80,8 +80,12 @@ class AlphaMetaDownloader: NSObject { Promise { resolver in let assetName = assetName() AF.request("https://api.github.com/repos/MetaCubeX/mihomo/releases/tags/Prerelease-Alpha").responseDecodable(of: ReleasesResp.self) { - guard let assets = $0.value?.assets, - let assetName, + guard let assets = $0.value?.assets else { + resolver.reject(errors.downloadFailed) + return + } + + guard let assetName, let asset = assets.first(where: { $0.name.contains(assetName) && !$0.name.contains("cgo") &&