diff options
author | Jeff Zhao <jeff.no.zhao@gmail.com> | 2023-10-08 22:48:25 -0400 |
---|---|---|
committer | Jeff Zhao <jeff.no.zhao@gmail.com> | 2023-10-08 22:48:25 -0400 |
commit | cfcefaf9985adf766557e48db4fc2fb6d7498094 (patch) | |
tree | 62436e2f133e6428e480ed8296dbd5b3547bdad8 /src | |
parent | 8412f0534c7c7c64d3a5ebc602fbb298b9f6eba7 (diff) |
fix unwrap() crash
Diffstat (limited to 'src')
-rw-r--r-- | src/ui/tab_list_builder.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ui/tab_list_builder.rs b/src/ui/tab_list_builder.rs index 2fda926..953dfee 100644 --- a/src/ui/tab_list_builder.rs +++ b/src/ui/tab_list_builder.rs @@ -40,11 +40,12 @@ impl TabLabel { let home_dir_str = home_dir.to_string_lossy().into_owned(); full_path_str = full_path_str.replace(&home_dir_str, "~"); } + eprintln!("full_path_str: {:?}", full_path_str); let last = Path::new(&full_path_str) .file_name() - .unwrap() + .unwrap_or_default() .to_str() - .unwrap() + .unwrap_or_default() .to_string(); TabLabel { long: full_path_str, |