Skip to content

Commit

Permalink
Fix issue go-xorm#894
Browse files Browse the repository at this point in the history
  • Loading branch information
sleagon committed Apr 16, 2018
1 parent fc1b13e commit 9e1c0ee
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion session_find.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,13 @@ func (session *Session) cacheFind(t reflect.Type, sqlStr string, rowsSlicePtr in
return err
}
bean := cacher.GetBean(tableName, sid)
if bean == nil || reflect.ValueOf(bean).Elem().Type() != t {

// fix issue #894
ckt := t
if ckt.Kind() == reflect.Ptr {
ckt = t.Elem()
}
if bean == nil || reflect.ValueOf(bean).Elem().Type() != ckt {
ides = append(ides, id)
ididxes[sid] = idx
} else {
Expand Down

0 comments on commit 9e1c0ee

Please sign in to comment.