Fix a len(0) check that wasn't occurring

This commit is contained in:
Aaron L 2016-11-15 20:34:36 -08:00
parent ac48562dc2
commit a8330b18ad
2 changed files with 78 additions and 0 deletions

View file

@ -164,6 +164,9 @@ func (l loadRelationshipState) callLoadFunction(depth int, loadingFrom reflect.V
// Get a loader instance from anything we have, *struct, or *[]*struct
val := reflect.Indirect(loadingFrom)
if bkind == kindPtrSliceStruct {
if val.Len() == 0 {
return nil
}
val = reflect.Indirect(val.Index(0))
}