diff --git a/agent/utils/encrypt/encrypt.go b/agent/utils/encrypt/encrypt.go index 6130fceaf..9a48e493f 100644 --- a/agent/utils/encrypt/encrypt.go +++ b/agent/utils/encrypt/encrypt.go @@ -69,6 +69,11 @@ func StringDecryptWithBase64(text string) (string, error) { } func StringDecryptWithKey(text, key string) (string, error) { + defer func() { + if r := recover(); r != nil { + global.LOG.Errorf("A panic occurred during string decrypt with key, error message: %v", r) + } + }() if len(text) == 0 { return "", nil } diff --git a/core/utils/encrypt/encrypt.go b/core/utils/encrypt/encrypt.go index f42269ac0..2a8539576 100644 --- a/core/utils/encrypt/encrypt.go +++ b/core/utils/encrypt/encrypt.go @@ -70,6 +70,11 @@ func StringDecrypt(text string) (string, error) { } func StringDecryptWithKey(text, key string) (string, error) { + defer func() { + if r := recover(); r != nil { + global.LOG.Errorf("A panic occurred during string decrypt with key, error message: %v", r) + } + }() if len(text) == 0 { return "", nil }