From f5c7f12a0e99fe49233390c7a0e04bbf5ef0e302 Mon Sep 17 00:00:00 2001 From: GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> Date: Wed, 28 Jun 2023 18:21:16 +0200 Subject: fix: Use empty map for enabled mods (#397) if treating enabledmods.json as object fails --- src-tauri/src/mod_management/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src-tauri') diff --git a/src-tauri/src/mod_management/mod.rs b/src-tauri/src/mod_management/mod.rs index a52c6980..5d745f64 100644 --- a/src-tauri/src/mod_management/mod.rs +++ b/src-tauri/src/mod_management/mod.rs @@ -294,7 +294,8 @@ pub fn get_installed_mods_and_properties( }; let mut installed_mods = Vec::new(); - let mapping = enabled_mods.as_object().unwrap(); + let binding = serde_json::Map::new(); // Empty map in case treating as object fails + let mapping = enabled_mods.as_object().unwrap_or(&binding); // Use list of installed mods and set enabled based on `enabledmods.json` for mut current_mod in found_installed_mods { -- cgit v1.2.3