fix: Fix panic issue caused by 1pctl command

This commit is contained in:
ssongliu 2025-12-25 12:10:51 +08:00
parent 41bae1e636
commit 9b9ba2e66e

View file

@ -72,7 +72,9 @@ 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 global.LOG != nil {
global.LOG.Errorf("A panic occurred during string decrypt with key, error message: %v", r)
}
}
}()
if len(text) == 0 {