BlueGit

ict rusty-teams

Validate program before attempting to launch

Check if program is known before launching.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

metis Joe Mild · pushed by metis

Authored 2026-11-13 · 2 weeks ago

Hash
58b62644210eb14a6893dee4cb9597f24666864f
Parent
01b3b069
1 file changed +2 −1
crates/app-state/src/external_browser.rs +2 −1
@@ -51,7 +51,8 @@ pub fn open_url(cx: &mut App, store: &Store, url: &str) {
51 51 match load(store) {
52 52 ExternalBrowser::System => cx.open_url(url),
53 53 ExternalBrowser::Program(program) => {
54 if launch_program(&program, url).is_err() {
54 let known = available_choices().iter().any(|choice| choice.id == program);
55 if !known || launch_program(&program, url).is_err() {
55 56 cx.open_url(url);
56 57 }
57 58 }
@@ -51,7 +51,8 @@ pub fn open_url(cx: &mut App, store: &Store, url: &str) {
51 match load(store) {
51 match load(store) {
52 ExternalBrowser::System => cx.open_url(url),
52 ExternalBrowser::System => cx.open_url(url),
53 ExternalBrowser::Program(program) => {
53 ExternalBrowser::Program(program) => {
54 if launch_program(&program, url).is_err() {
54 let known = available_choices().iter().any(|choice| choice.id == program);
55 if !known || launch_program(&program, url).is_err() {
55 cx.open_url(url);
56 cx.open_url(url);
56 }
57 }
57 }
58 }