From a72dbd3471acdf19e43d405169948d0e276b7b7d Mon Sep 17 00:00:00 2001 From: Julien Blanchard Date: Mon, 1 Mar 2021 15:54:29 +0100 Subject: [PATCH] Fix bookmarks selection of the start page --- src/main.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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) }