Skip to content

Commit

Permalink
Return empty string if route cannot be found
Browse files Browse the repository at this point in the history
  • Loading branch information
madmikeross committed Dec 22, 2023
1 parent 7f224d2 commit 390112a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,13 @@ async fn routes_to_handler(
to_system_name: String,
graph: Arc<Graph>,
) -> Result<impl Reply, Rejection> {
let route = find_shortest_route(graph, from_system_name, to_system_name)
match find_shortest_route(graph, from_system_name, to_system_name)
.await
.unwrap()
.unwrap();
Ok(json::<Vec<_>>(&route))
{
None => Ok(json::<String>(&String::from(""))),
Some(route) => Ok(json::<Vec<_>>(&route)),
}
}

async fn wormholes_refresh_handler(
Expand Down

0 comments on commit 390112a

Please sign in to comment.