Skip to content

Commit

Permalink
Don't crash if Firefox is installed, but profiles.ini can't be found
Browse files Browse the repository at this point in the history
When user has installed Firefox, but never ran it, then the profiles.ini does not yet exist.
  • Loading branch information
liias committed Apr 25, 2023
1 parent 1f17c83 commit 92be6a9
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/firefox_profiles_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,20 @@ pub fn find_firefox_profiles(
let mut browser_profiles: Vec<InstalledBrowserProfile> = Vec::new();

let profiles_ini_path = firefox_profiles_dir.join("profiles.ini");
debug!("profiles_ini_path: {:?}", profiles_ini_path);
debug!(
"profiles_ini_path: {:?}",
profiles_ini_path
);

// When user has installed Firefox, but never ran it, then the profiles.ini does not yet exist
if !profiles_ini_path.exists() {
info!(
"Skipping Firefox, because profiles.ini does not exist at '{}'",
profiles_ini_path.display()
);

return browser_profiles;
}

let mut ini_default = IniDefault::default();
ini_default.case_sensitive = true;
Expand Down

0 comments on commit 92be6a9

Please sign in to comment.