add check in prompt_confirmation_menu to make sure confirmations is not empty

This commit is contained in:
Carson McManus 2022-08-04 23:07:43 -04:00
parent 980a14deb1
commit 0d90792c47

View file

@ -125,6 +125,10 @@ where
pub(crate) fn prompt_confirmation_menu( pub(crate) fn prompt_confirmation_menu(
confirmations: Vec<Confirmation>, confirmations: Vec<Confirmation>,
) -> anyhow::Result<(Vec<Confirmation>, Vec<Confirmation>)> { ) -> anyhow::Result<(Vec<Confirmation>, Vec<Confirmation>)> {
if confirmations.len() == 0 {
bail!("no confirmations")
}
let mut to_accept_idx: HashSet<usize> = HashSet::new(); let mut to_accept_idx: HashSet<usize> = HashSet::new();
let mut to_deny_idx: HashSet<usize> = HashSet::new(); let mut to_deny_idx: HashSet<usize> = HashSet::new();