Skip to content

Commit

Permalink
Merge pull request #1788 from apiraino/handle-no-pr-prefs
Browse files Browse the repository at this point in the history
Handle when user has no PR prefs set
  • Loading branch information
Mark-Simulacrum authored Apr 8, 2024
2 parents c6fa165 + f232351 commit 1cf4ceb
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 1cf4ceb

Please sign in to comment.