Skip to content

Commit

Permalink
fix(wrapped): fix crash when history is empty (#2508)
Browse files Browse the repository at this point in the history
* fix(wrapped): fix crash when history is empty

* style: fix format
  • Loading branch information
alexandregv authored Jan 7, 2025
1 parent cea5f84 commit 522c167
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/atuin/src/command/client/wrapped.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@ pub async fn run(
);

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

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

0 comments on commit 522c167

Please sign in to comment.