From 5710ffb504d765d07da96b9ec7086a62a9bf71ee Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Thu, 24 Oct 2024 02:30:59 -0700 Subject: [PATCH] fix(html): add fallback for search if filename is invalid (#650) --- src/html/search.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/html/search.rs b/src/html/search.rs index dd2ad0bf..884bd614 100644 --- a/src/html/search.rs +++ b/src/html/search.rs @@ -34,7 +34,9 @@ fn doc_nodes_into_search_index_node( super::util::all_deprecated(&doc_nodes.iter().collect::>()); let mut location = doc_nodes[0].location.clone(); - let location_url = ModuleSpecifier::parse(&location.filename).unwrap(); + let Ok(location_url) = ModuleSpecifier::parse(&location.filename) else { + return vec![]; + }; location.filename = if let Some(short_path) = ctx .doc_nodes .keys()