fix: Fix panic issue caused by 1pctl command (#11453)

Refs  #11449
This commit is contained in:
ssongliu 2025-12-25 12:17:02 +08:00 committed by GitHub
parent 41bae1e636
commit f4587d0ae5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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 {