Skip to content

Commit

Permalink
fix: Use empty map for enabled mods (#397)
Browse files Browse the repository at this point in the history
if treating enabledmods.json as object fails
  • Loading branch information
GeckoEidechse authored Jun 28, 2023
1 parent aa8c837 commit f5c7f12
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src-tauri/src/mod_management/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit f5c7f12

Please sign in to comment.