mirror of
https://github.com/golang/go
synced 2024-11-25 00:57:59 -07:00
do not crash on nil data value
R=r DELTA=3 (3 added, 0 deleted, 0 changed) OCL=34606 CL=34609
This commit is contained in:
parent
c5a441ac70
commit
b198b994a1
@ -575,6 +575,9 @@ func (st *state) findVar(s string) reflect.Value {
|
||||
for i := 0; i < len(elems); i++ {
|
||||
// Look up field; data must be a struct.
|
||||
data = reflect.Indirect(data);
|
||||
if data == nil {
|
||||
return nil
|
||||
}
|
||||
typ, ok := data.Type().(*reflect.StructType);
|
||||
if !ok {
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user