Skip to content

Commit

Permalink
fix format label value panic
Browse files Browse the repository at this point in the history
  • Loading branch information
shitoumomo committed Jan 26, 2022
1 parent 7e36701 commit 1e38b25
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/instance/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ func (ins *baseTcInstance) GetMonitorQueryKey() string {
return ins.instanceId
}

func (ins *baseTcInstance) GetFieldValueByName(name string) (string, error) {
func (ins *baseTcInstance) GetFieldValueByName(name string) (val string, err error) {
defer func() {
if err := recover(); err != nil {
//nothing ignore err
}
}()
v := ins.value.FieldByName(name)
if v.Kind() == reflect.Ptr {
v = reflect.Indirect(v)
Expand Down

0 comments on commit 1e38b25

Please sign in to comment.