don't panic on invalid dates

This commit is contained in:
Robin Appelman 2026-11-15 14:24:16 +01:00
commit 9ab5d1903f
Signed by: robin
SSH key fingerprint: SHA256:kifqgrqnut7q1YUIrI0AdMNC23qiKAS/T9uGFmIYvbE
2 changed files with 15 additions and 11 deletions

View file

@ -36,7 +36,7 @@ pub trait EventHandler: Default {
start_time: &mut Option<NaiveDateTime>,
subjects: &mut SubjectMap<Self::PerSubjectData>,
) -> Result<(), Error> {
let event_time: NaiveDateTime = raw_event.date.try_into().unwrap();
let event_time: NaiveDateTime = raw_event.date.try_into()?;
let match_time = match start_time {
Some(start_time) => (event_time - *start_time).num_seconds() as u32,
None => {