Skip to content

Commit 522c167

Browse files
authored
fix(wrapped): fix crash when history is empty (#2508)
* fix(wrapped): fix crash when history is empty * style: fix format
1 parent cea5f84 commit 522c167

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/atuin/src/command/client/wrapped.rs

+4
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,10 @@ pub async fn run(
280280
);
281281

282282
let history = db.range(start, end).await?;
283+
if history.is_empty() {
284+
println!("Your history for {year} is empty!\nMaybe 'atuin import' could help you import your previous history 🪄");
285+
return Ok(());
286+
}
283287

284288
// Compute overall stats using existing functionality
285289
let stats = compute(settings, &history, 10, 1).expect("Failed to compute stats");

0 commit comments

Comments
 (0)