From a8986e75eba767b6a1296fd4da3959d07b8e87a5 Mon Sep 17 00:00:00 2001 From: Daniel Cadenas Date: Thu, 22 Aug 2024 11:03:54 -0300 Subject: [PATCH] Check for empty name --- src/fetch_friendly_id.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/fetch_friendly_id.rs b/src/fetch_friendly_id.rs index bcb7e3c..3d1cbb1 100644 --- a/src/fetch_friendly_id.rs +++ b/src/fetch_friendly_id.rs @@ -19,7 +19,10 @@ pub async fn fetch_friendly_id( return npub_or_pubkey; }; - let name_or_npub_or_pubkey = metadata.name.unwrap_or(npub_or_pubkey); + let name_or_npub_or_pubkey = metadata + .name + .filter(|name| !name.is_empty()) + .unwrap_or(npub_or_pubkey); if let Some(nip05_value) = metadata.nip05 { if verify {