This commit fixes a crash that happens when the user attempts to
navigate to `gemini://'.
Castor now displays an error message:
Could not connect to :1965
---
src/gemini/client.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/gemini/client.rs b/src/gemini/client.rs
index bf28cf7..882d81f 100644
--- a/src/gemini/client.rs
+++ b/src/gemini/client.rs
@@ -8,7 +8,7 @@ use crate::protocols::*;
pub fn get_data<T: Protocol>(url: T) -> Result<(Option<Vec<u8>>, Vec<u8>), String> {
let url = url.get_source_url();
- let host = url.host_str().unwrap();
+ let host = url.host_str().unwrap_or("");
let port = url.port().unwrap_or(1965);
let urlf = format!("{}:{}", host, port);
--
2.20.1