1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-26 03:01:28 +00:00

orm: fix panic multi insert when slice lenght is 1 & the value is pointer

This commit is contained in:
miraclesu 2016-04-13 20:14:02 +08:00
parent 002dcaab23
commit 3a3f70027c

View File

@ -191,7 +191,7 @@ func (o *orm) InsertMulti(bulk int, mds interface{}) (int64, error) {
if bulk <= 1 {
for i := 0; i < sind.Len(); i++ {
ind := sind.Index(i)
ind := reflect.Indirect(sind.Index(i))
mi, _ := o.getMiInd(ind.Interface(), false)
id, err := o.alias.DbBaser.Insert(o.db, mi, ind, o.alias.TZ)
if err != nil {