From 0d90792c477d224931ad1555f425a3dda5e3341e Mon Sep 17 00:00:00 2001 From: Carson McManus Date: Thu, 4 Aug 2022 23:07:43 -0400 Subject: [PATCH] add check in prompt_confirmation_menu to make sure confirmations is not empty --- src/tui.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tui.rs b/src/tui.rs index 37b2231..da59d90 100644 --- a/src/tui.rs +++ b/src/tui.rs @@ -125,6 +125,10 @@ where pub(crate) fn prompt_confirmation_menu( confirmations: Vec, ) -> anyhow::Result<(Vec, Vec)> { + if confirmations.len() == 0 { + bail!("no confirmations") + } + let mut to_accept_idx: HashSet = HashSet::new(); let mut to_deny_idx: HashSet = HashSet::new();