Skip to content

Commit

Permalink
check if nothing selected on kdialog
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Ratés committed Jan 29, 2024
1 parent 8a7fa1c commit 7bbbb22
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,13 @@ fn process_id_key_with_kdialog(
if is_succsessful {
let movie_selected = std::str::from_utf8(&out.stdout)?.trim_end_matches('\n');
let file_id = filename_map.get(movie_selected);
//Returs file_id
Ok(file_id.unwrap().to_string())

if let Some(value) = file_id {
//Returs file_id
Ok(value.to_string())
} else {
Err("Error selecting movie.")?
}
} else {
Err("Movie not selected.")?
}
Expand Down

0 comments on commit 7bbbb22

Please sign in to comment.