From 455c1f0a0ca6cd0f489305cda4b25a01ee708d4c Mon Sep 17 00:00:00 2001 From: RedstoneWizard08 Date: Mon, 20 Mar 2023 17:54:37 -0700 Subject: [PATCH] Fix file not found error --- common/src/installer/mods.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/common/src/installer/mods.rs b/common/src/installer/mods.rs index 384a66f..82ad9d7 100644 --- a/common/src/installer/mods.rs +++ b/common/src/installer/mods.rs @@ -143,13 +143,15 @@ impl ModInstaller { .expect("Could not move the BepInEx folder!"); } - for file in bep_in_ex_dir.read_dir().unwrap() { - let file = file.unwrap(); - - instance_mod.paths.push( - "BepInEx/plugins/".to_string() - + file.file_name().into_string().unwrap().as_str(), - ); + if bep_in_ex_dir.exists() && bep_in_ex_dir.is_dir() { + for file in bep_in_ex_dir.read_dir().unwrap() { + let file = file.unwrap(); + + instance_mod.paths.push( + "BepInEx/plugins/".to_string() + + file.file_name().into_string().unwrap().as_str(), + ); + } } } } else {