Skip to content

Commit 5710ffb

Browse files
authored
fix(html): add fallback for search if filename is invalid (#650)
1 parent b4fe44f commit 5710ffb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/html/search.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ fn doc_nodes_into_search_index_node(
3434
super::util::all_deprecated(&doc_nodes.iter().collect::<Vec<_>>());
3535

3636
let mut location = doc_nodes[0].location.clone();
37-
let location_url = ModuleSpecifier::parse(&location.filename).unwrap();
37+
let Ok(location_url) = ModuleSpecifier::parse(&location.filename) else {
38+
return vec![];
39+
};
3840
location.filename = if let Some(short_path) = ctx
3941
.doc_nodes
4042
.keys()

0 commit comments

Comments
 (0)