Skip to content

Commit

Permalink
error handling on receiving no profiles from relay
Browse files Browse the repository at this point in the history
  • Loading branch information
believethehype committed Mar 15, 2023
1 parent 24ec61a commit 882914d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nostr.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

}
Expand Down

0 comments on commit 882914d

Please sign in to comment.