From f4587d0ae5559fbfac38e23a980b9b3e6eedc86a Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Thu, 25 Dec 2025 12:17:02 +0800 Subject: [PATCH] fix: Fix panic issue caused by 1pctl command (#11453) Refs #11449 --- core/utils/encrypt/encrypt.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/utils/encrypt/encrypt.go b/core/utils/encrypt/encrypt.go index 2a8539576..753fdad12 100644 --- a/core/utils/encrypt/encrypt.go +++ b/core/utils/encrypt/encrypt.go @@ -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 {