sdk: fix for invalid npub in InputToProfile()

This commit is contained in:
fiatjaf
2025-10-13 23:55:43 +00:00
parent 47b1608e6b
commit 776a82ba7f

View File

@@ -16,7 +16,11 @@ func InputToProfile(ctx context.Context, input string) *nostr.ProfilePointer {
}
// 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 {
case "npub":
return &nostr.ProfilePointer{PublicKey: data.(nostr.PubKey)}