Fixed a Helix crash on launch when the install directory cannot be

canonicalized (the ol' `.unwrap_or`)
pull/12879/head
GoldenGuy1000 2025-02-15 03:22:32 -08:00
parent 7275b7f850
commit 81e1d6de87
1 changed files with 1 additions and 1 deletions

View File

@ -69,7 +69,7 @@ fn prioritize_runtime_dirs() -> Vec<PathBuf> {
// canonicalize the path in case the executable is symlinked
let exe_rt_dir = std::env::current_exe()
.ok()
.and_then(|path| std::fs::canonicalize(path).ok())
.and_then(|path| Some(std::fs::canonicalize(&path).unwrap_or(path)))
.and_then(|path| path.parent().map(|path| path.to_path_buf().join(RT_DIR)))
.unwrap();
rt_dirs.push(exe_rt_dir);