chore: fix build

This commit is contained in:
2024-02-10 11:19:18 +07:00
parent 739ba63e6c
commit 35c5b5fb78
10 changed files with 136 additions and 43 deletions

View File

@@ -26,8 +26,10 @@ pub async fn get_profile(id: &str, nostr: State<'_, Nostr>) -> Result<Metadata,
.await
.expect("Get metadata failed");
let event = events.first().unwrap();
let metadata: Metadata = Metadata::from_json(&event.content).unwrap();
Ok(metadata)
if let Some(event) = events.first() {
let metadata: Metadata = Metadata::from_json(&event.content).unwrap();
Ok(metadata)
} else {
Err(())
}
}