From 6f45aa9937602f3d03cd83cfb5fb3c541fac4adf Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Thu, 12 Dec 2024 11:31:51 +0000 Subject: fix: defend against empty`tags` prevent a panic when tags are of an unexpect length --- src/bin/ngit/sub_commands/list.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/bin/ngit/sub_commands') diff --git a/src/bin/ngit/sub_commands/list.rs b/src/bin/ngit/sub_commands/list.rs index b7bfd24..ee015ef 100644 --- a/src/bin/ngit/sub_commands/list.rs +++ b/src/bin/ngit/sub_commands/list.rs @@ -77,9 +77,9 @@ pub async fn launch() -> Result<()> { .iter() .filter(|e| { status_kinds().contains(&e.kind) - && e.tags - .iter() - .any(|t| t.as_slice()[1].eq(&proposal.id.to_string())) + && e.tags.iter().any(|t| { + t.as_slice().len() > 1 && t.as_slice()[1].eq(&proposal.id.to_string()) + }) }) .collect::>() .first() -- cgit v1.2.3