Fix a len(0) check that wasn't occurring
This commit is contained in:
parent
ac48562dc2
commit
a8330b18ad
2 changed files with 78 additions and 0 deletions
queries
|
@ -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))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue