From 7261a4b515ede91d050a9c898e867d0baf794662 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Wed, 26 Nov 2025 09:04:47 -0300 Subject: [PATCH] sdk: fix InputToProfile() to support nip05 again. --- sdk/input.go | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/sdk/input.go b/sdk/input.go index d847c1c..4520dda 100644 --- a/sdk/input.go +++ b/sdk/input.go @@ -17,16 +17,14 @@ func InputToProfile(ctx context.Context, input string) *nostr.ProfilePointer { // handle nip19 codes, if that's the case prefix, data, err := nip19.Decode(input) - if err != nil { - return nil - } - - switch prefix { - case "npub": - return &nostr.ProfilePointer{PublicKey: data.(nostr.PubKey)} - case "nprofile": - pp := data.(nostr.ProfilePointer) - return &pp + if err == nil { + switch prefix { + case "npub": + return &nostr.ProfilePointer{PublicKey: data.(nostr.PubKey)} + case "nprofile": + pp := data.(nostr.ProfilePointer) + return &pp + } } // handle nip05 ids, if that's the case