diff --git a/src-tauri/src/app/gui.rs b/src-tauri/src/app/gui.rs index 9c48484..c547ec6 100644 --- a/src-tauri/src/app/gui.rs +++ b/src-tauri/src/app/gui.rs @@ -2,6 +2,7 @@ use std::{sync::{Arc, Mutex}, thread}; use tracing::{error, info, debug}; use tauri::{Manager, Window}; +use uuid::Uuid; use crate::{LAUNCHER_DIRECTORY, minecraft::{launcher::{LauncherData, LaunchingParameter}, prelauncher, progress::ProgressUpdate, auth::{MinecraftAccount, self}}, HTTP_CLIENT}; use crate::app::api::{Branches, Changelog, ContentDelivery, News}; @@ -131,7 +132,16 @@ async fn run_client(build_id: u32, account_data: MinecraftAccount, options: Laun let (account_name, uuid, token, user_type) = match account_data { MinecraftAccount::MsaAccount { name, uuid, token, .. } => (name, uuid, token, "msa".to_string()), - MinecraftAccount::OfflineAccount { name, uuid } => (name, uuid, "-".to_string(), "legacy".to_string()) + MinecraftAccount::OfflineAccount { name, uuid } => { + // A UUID of length less than 2 is invalid, so we generate a new one + let uuid = if uuid.len() < 2 { + Uuid::new_v4().to_string() + } else { + uuid + }; + + (name, uuid, "-".to_string(), "legacy".to_string()) + } }; let parameters = LaunchingParameter {