upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/bin/ngit/sub_commands
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-12-12 11:31:51 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2024-12-12 11:32:48 +0000
commit6f45aa9937602f3d03cd83cfb5fb3c541fac4adf (patch)
treec64277a455b0b8c07c4e501a0716f16365b88c33 /src/bin/ngit/sub_commands
parent2b49a548169bf9bc3a3ef667a7e952e31e878bab (diff)
fix: defend against empty`tags`
prevent a panic when tags are of an unexpect length
Diffstat (limited to 'src/bin/ngit/sub_commands')
-rw-r--r--src/bin/ngit/sub_commands/list.rs6
1 files changed, 3 insertions, 3 deletions
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<()> {
77 .iter() 77 .iter()
78 .filter(|e| { 78 .filter(|e| {
79 status_kinds().contains(&e.kind) 79 status_kinds().contains(&e.kind)
80 && e.tags 80 && e.tags.iter().any(|t| {
81 .iter() 81 t.as_slice().len() > 1 && t.as_slice()[1].eq(&proposal.id.to_string())
82 .any(|t| t.as_slice()[1].eq(&proposal.id.to_string())) 82 })
83 }) 83 })
84 .collect::<Vec<&nostr::Event>>() 84 .collect::<Vec<&nostr::Event>>()
85 .first() 85 .first()