From 776a82ba7f690c4558df331c746d1d0bb05d2b43 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Mon, 13 Oct 2025 23:55:43 +0000 Subject: [PATCH] sdk: fix for invalid npub in InputToProfile() --- sdk/input.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sdk/input.go b/sdk/input.go index d9ffbdc..d847c1c 100644 --- a/sdk/input.go +++ b/sdk/input.go @@ -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)}