From 428cf33bc105a2f9553834041ff6cc7c04f3f46f Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Fri, 9 Jan 2026 22:35:53 -0300 Subject: [PATCH] nip49: fix decryption error handling. --- nip49/nip49.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nip49/nip49.go b/nip49/nip49.go index d402db4..d101984 100644 --- a/nip49/nip49.go +++ b/nip49/nip49.go @@ -57,7 +57,10 @@ func Encrypt(secretKey [32]byte, password string, logn uint8, ksb KeySecurityByt func Decrypt(bech32string string, password string) (secretKey nostr.SecretKey, err error) { secb, err := DecryptToBytes(bech32string, password) - return nostr.SecretKey(secb), err + if err != nil { + return [32]byte{}, err + } + return nostr.SecretKey(secb), nil } func DecryptToBytes(bech32string string, password string) (secretKey []byte, err error) {