sdk: fix for invalid npub in InputToProfile()
This commit is contained in:
@@ -16,7 +16,11 @@ func InputToProfile(ctx context.Context, input string) *nostr.ProfilePointer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// handle nip19 codes, if that's the case
|
// handle nip19 codes, if that's the case
|
||||||
prefix, data, _ := nip19.Decode(input)
|
prefix, data, err := nip19.Decode(input)
|
||||||
|
if err != nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
switch prefix {
|
switch prefix {
|
||||||
case "npub":
|
case "npub":
|
||||||
return &nostr.ProfilePointer{PublicKey: data.(nostr.PubKey)}
|
return &nostr.ProfilePointer{PublicKey: data.(nostr.PubKey)}
|
||||||
|
|||||||
Reference in New Issue
Block a user