From 87e08d4802bcff28f8bdf9a8f23b439d1204e1e4 Mon Sep 17 00:00:00 2001 From: GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> Date: Mon, 29 May 2023 18:50:16 +0200 Subject: fix: Return error on TS package index fetch fail (#371) instead of panicking --- src-tauri/src/mod_management/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src-tauri/src/mod_management/mod.rs b/src-tauri/src/mod_management/mod.rs index 43464c8f..c6374623 100644 --- a/src-tauri/src/mod_management/mod.rs +++ b/src-tauri/src/mod_management/mod.rs @@ -342,8 +342,7 @@ async fn get_ns_mod_download_url(thunderstore_mod_string: &str) -> Result Result, anyhow::Error> { log::info!("Attempting to get dependencies for: {thunderstore_mod_string}"); - // TODO: This will crash the thread if not internet connection exist. `match` should be used instead - let index = thermite::api::get_package_index().unwrap().to_vec(); + let index = thermite::api::get_package_index()?.to_vec(); // String replace works but more care should be taken in the future let ts_mod_string_url = thunderstore_mod_string.replace('-', "/"); -- cgit v1.2.3