aboutsummaryrefslogtreecommitdiff
path: root/src-tauri/src/mod_management
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2023-06-28 18:21:16 +0200
committerGitHub <noreply@github.com>2023-06-28 18:21:16 +0200
commitf5c7f12a0e99fe49233390c7a0e04bbf5ef0e302 (patch)
tree3853ceabeeb784dd44c00a515bf2684d9e3cbbb0 /src-tauri/src/mod_management
parentaa8c8377edd69dc5ac50441ec2816b5711d0e128 (diff)
downloadFlightCore-f5c7f12a0e99fe49233390c7a0e04bbf5ef0e302.tar.gz
FlightCore-f5c7f12a0e99fe49233390c7a0e04bbf5ef0e302.zip
fix: Use empty map for enabled mods (#397)
if treating enabledmods.json as object fails
Diffstat (limited to 'src-tauri/src/mod_management')
-rw-r--r--src-tauri/src/mod_management/mod.rs3
1 files changed, 2 insertions, 1 deletions
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 {