mirror of https://github.com/helix-editor/helix
Fixed a Helix crash on launch when the install directory cannot be
canonicalized (the ol' `.unwrap_or`)pull/12879/head
parent
7275b7f850
commit
81e1d6de87
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue