mirror of
https://github.com/believethehype/nostdress.git
synced 2026-06-16 22:09:43 -07:00
error handling on receiving no profiles from relay
This commit is contained in:
@@ -121,7 +121,11 @@ func GetNostrProfileMetaData(npub string) (nostr.ProfileMetadata, error) {
|
||||
}
|
||||
relay.Close()
|
||||
|
||||
metadata, err = nostr.ParseMetadata(evs[0])
|
||||
if len(evs) > 0 {
|
||||
metadata, err = nostr.ParseMetadata(evs[0])
|
||||
} else {
|
||||
err = fmt.Errorf("no profile found for npub %s on relay %s", npub, url)
|
||||
}
|
||||
return *metadata, err
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user