Skip to content

Commit f4587d0

Browse files
authored
fix: Fix panic issue caused by 1pctl command (#11453)
Refs #11449
1 parent 41bae1e commit f4587d0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/utils/encrypt/encrypt.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ func StringDecrypt(text string) (string, error) {
7272
func StringDecryptWithKey(text, key string) (string, error) {
7373
defer func() {
7474
if r := recover(); r != nil {
75-
global.LOG.Errorf("A panic occurred during string decrypt with key, error message: %v", r)
75+
if global.LOG != nil {
76+
global.LOG.Errorf("A panic occurred during string decrypt with key, error message: %v", r)
77+
}
7678
}
7779
}()
7880
if len(text) == 0 {

0 commit comments

Comments
 (0)