Skip to content

Commit 1e38b25

Browse files
committed
fix format label value panic
1 parent 7e36701 commit 1e38b25

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/instance/instance.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ func (ins *baseTcInstance) GetMonitorQueryKey() string {
3333
return ins.instanceId
3434
}
3535

36-
func (ins *baseTcInstance) GetFieldValueByName(name string) (string, error) {
36+
func (ins *baseTcInstance) GetFieldValueByName(name string) (val string, err error) {
37+
defer func() {
38+
if err := recover(); err != nil {
39+
//nothing ignore err
40+
}
41+
}()
3742
v := ins.value.FieldByName(name)
3843
if v.Kind() == reflect.Ptr {
3944
v = reflect.Indirect(v)

0 commit comments

Comments
 (0)