Skip to content

Commit 79613ad

Browse files
Handle the case where missing commits returns 0 commits, not just errors
1 parent 3690b6e commit 79613ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

site/src/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ pub fn handle_status_page(data: &InputData) -> status::Response {
313313
}
314314

315315
pub fn handle_next_commit(data: &InputData) -> Option<String> {
316-
data.missing_commits().ok().map(|c| c.into_iter().next().unwrap().sha)
316+
data.missing_commits().ok().and_then(|c| c.into_iter().next()).map(|c| c.sha)
317317
}
318318

319319
pub fn handle_graph(body: graph::Request, data: &InputData) -> ServerResult<graph::Response> {

0 commit comments

Comments
 (0)