Skip to content

Commit

Permalink
fix(html): add fallback for search if filename is invalid (#650)
Browse files Browse the repository at this point in the history
  • Loading branch information
crowlKats authored Oct 24, 2024
1 parent b4fe44f commit 5710ffb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/html/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ fn doc_nodes_into_search_index_node(
super::util::all_deprecated(&doc_nodes.iter().collect::<Vec<_>>());

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()
Expand Down

0 comments on commit 5710ffb

Please sign in to comment.