diff --git a/src-tauri/src/file_helpers.rs b/src-tauri/src/file_helpers.rs index 6a700da..635b244 100644 --- a/src-tauri/src/file_helpers.rs +++ b/src-tauri/src/file_helpers.rs @@ -132,7 +132,7 @@ pub fn read_file(path: String) -> String { Ok(file) => file, Err(e) => { // Send back error for handling by the caller - return e; + return null; } }; diff --git a/src-tauri/src/unzip.rs b/src-tauri/src/unzip.rs index ee9a90d..81e3e2b 100644 --- a/src-tauri/src/unzip.rs +++ b/src-tauri/src/unzip.rs @@ -97,9 +97,9 @@ pub fn unzip( } // If downloading full build, emit that the jar was extracted with it - if zipfile = "GrasscutterCulti3.4.zip" { + if zipfile == "GrasscutterCulti3.4.zip" { window - .emit("jar_extracted", destpath.to_string() + (destpath.to_string() + "grasscutter.jar")) + .emit("jar_extracted", destpath.to_string() + &((destpath.to_string() + "grasscutter.jar"))) .unwrap(); } diff --git a/src/utils/server.ts b/src/utils/server.ts index e1e572c..4b5b425 100644 --- a/src/utils/server.ts +++ b/src/utils/server.ts @@ -40,5 +40,11 @@ export async function encryptionEnabled(path: string) { return false } + // Also check if null just in case + if (serverConf == null) { + console.log(`Server config at ${path} not found or invalid. Be sure to run the server at least once to generate it`) + return false + } + return serverConf.server.http.encryption.useEncryption }