fix parseError panic when FieldByName return nil
This commit is contained in:
parent
aa89edef9b
commit
6dbb8eedb0
|
@ -81,8 +81,8 @@ func (u *Unpacker) parseError() error {
|
|||
retCodeValue := u.output.Elem().FieldByName("RetCode")
|
||||
messageValue := u.output.Elem().FieldByName("Message")
|
||||
|
||||
if retCodeValue.IsValid() && retCodeValue.Type().String() == "*int" &&
|
||||
messageValue.IsValid() && messageValue.Type().String() == "*string" &&
|
||||
if retCodeValue.Elem().IsValid() && retCodeValue.Type().String() == "*int" &&
|
||||
messageValue.Elem().IsValid() && messageValue.Type().String() == "*string" &&
|
||||
retCodeValue.Elem().Int() != 0 {
|
||||
|
||||
return &errors.QingCloudError{
|
||||
|
|
Loading…
Reference in New Issue