Skip to content

Commit

Permalink
fix(parser): do not panic if location not found
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnatarHe committed Oct 2, 2022
1 parent 8896fbd commit f35d9ed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ fn parse_info(

let matched = location_regex.captures(location_section);
if matched.is_none() {
return Err("location not found".into());
let dt = chrono::NaiveDateTime::parse_from_str(r#"1970-01-01 00:00:00 am"#, "%Y-%m-%e %l:%M:%S %p").unwrap();
return Ok(("".to_string(), dt));
}
let page_at_str = matched.unwrap().get(0).unwrap().as_str();

Expand Down

0 comments on commit f35d9ed

Please sign in to comment.