diff --git a/src/main.rs b/src/main.rs index 3447184..5bed317 100644 --- a/src/main.rs +++ b/src/main.rs @@ -425,7 +425,12 @@ fn follow_line(s: &mut Cursive, line: &str) { } fn follow_link(s: &mut Cursive, link: &str) { - let current_url = history::get_current_url().unwrap(); - let next_url = current_url.join(link).expect("Not a URL"); + let next_url = match history::get_current_url() { + Some(current_url) => { + current_url.join(link).expect("Not a URL") + }, + None => Url::parse(link).expect("Not a URL") + }; + visit_url(s, &next_url) }