Skip to content

Commit

Permalink
Handle when user has no PR prefs set
Browse files Browse the repository at this point in the history
  • Loading branch information
apiraino committed Apr 8, 2024
1 parent c6fa165 commit f232351
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/zulip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,13 @@ async fn query_pr_assignments(
let db_client = ctx.db.get().await;

let record = match subcommand {
"show" => get_review_prefs(&db_client, gh_id).await?,
"show" => {
let rec = get_review_prefs(&db_client, gh_id).await;
if rec.is_err() {
anyhow::bail!("No preferences set.")
}
rec?
}
_ => anyhow::bail!("Invalid subcommand."),
};

Expand Down

0 comments on commit f232351

Please sign in to comment.