From 4a2f074a3f4a041084a33c899bf4fc67444a7931 Mon Sep 17 00:00:00 2001 From: Simon Maddocks Date: Mon, 7 Feb 2022 00:17:28 +0000 Subject: [PATCH] Fix panic logic --- romulus_m.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/romulus_m.go b/romulus_m.go index bccd91e..3aa9015 100644 --- a/romulus_m.go +++ b/romulus_m.go @@ -44,9 +44,10 @@ func Decrypt(key []byte, ciphertext []byte, additionalData []byte) (plaintext [] } defer func() { - recover() - err = errors.New("Recoverd from panic in decrypt") - auth = false + if r := recover(); r != nil { + err = errors.New("Recovered from panic in decrypt") + auth = false + } }() plaintext = make([]byte, len(ciphertext))