fix(tasks): prevent tracking invalid times

This commit is contained in:
xeruf 2024-08-15 13:12:42 +03:00
parent fcd5e9c0c9
commit 9c0a688297
1 changed files with 9 additions and 1 deletions

View File

@ -713,7 +713,15 @@ impl Tasks {
} }
} }
} }
}.map(|time| self.track_at(Timestamp::from(time.timestamp() as u64))).is_some() }.filter(|time| {
if time.timestamp() > 0 {
self.track_at(Timestamp::from(time.timestamp() as u64));
true
} else {
warn!("Can only track times after 1970!");
false
}
}).is_some()
} }
pub(crate) fn track_at(&mut self, time: Timestamp) -> EventId { pub(crate) fn track_at(&mut self, time: Timestamp) -> EventId {