From 24cabc6019e702ac888a33311532a9832863b572 Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 2 Feb 2023 15:13:13 +0100 Subject: fix: Prevent ModsView from crashing if Northstar is not installed (#152) --- src-tauri/src/mod_management/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/mod_management/mod.rs b/src-tauri/src/mod_management/mod.rs index c37882fe..d269a627 100644 --- a/src-tauri/src/mod_management/mod.rs +++ b/src-tauri/src/mod_management/mod.rs @@ -196,7 +196,10 @@ fn parse_for_thunderstore_mod_string(nsmod_path: String) -> Result Result, String> { let ns_mods_folder = format!("{}/R2Northstar/mods/", game_install.game_path); - let paths = std::fs::read_dir(ns_mods_folder).unwrap(); + let paths = match std::fs::read_dir(ns_mods_folder) { + Ok(paths) => paths, + Err(_err) => return Err("No mods folder found".to_string()), + }; let mut directories: Vec = Vec::new(); let mut mods: Vec = Vec::new(); -- cgit v1.2.3