aboutsummaryrefslogtreecommitdiffstats
path: root/crates/daemon/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--crates/daemon/src/aclient/history/mod.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/crates/daemon/src/aclient/history/mod.rs b/crates/daemon/src/aclient/history/mod.rs
index 35abc89d..0b5f4982 100644
--- a/crates/daemon/src/aclient/history/mod.rs
+++ b/crates/daemon/src/aclient/history/mod.rs
@@ -181,7 +181,14 @@ impl HistoryExt for History {
let mut bytes = Bytes::new(bytes);
let timestamp = decode::read_u64(&mut bytes).map_err(error_report)?;
let duration = decode::read_int(&mut bytes)
- .map(|int: i64| Duration::from_nanos(u64::try_from(int).expect("to be small enough")))
+ .map(|int: i64| {
+ if int.is_negative() {
+ // TODO: We should probably handle this case differently <2026-08-23>
+ Duration::from_nanos(0)
+ } else {
+ Duration::from_nanos(u64::try_from(int).expect("to be small enough"))
+ }
+ })
.map_err(error_report)?;
let exit = decode::read_int(&mut bytes).map_err(error_report)?;