Merge pull request #215 from kaneshin/fix_invlaid_memory_helpers

Fix to refer invalid memory access on helpers.go
This commit is contained in:
Lunny Xiao 2015-03-06 22:13:34 +08:00
commit e8387336f4
1 changed files with 4 additions and 1 deletions

View File

@ -282,7 +282,10 @@ func query2(db *core.DB, sqlStr string, params ...interface{}) (resultsSlice []m
}
func setColumnTime(bean interface{}, col *core.Column, t time.Time) {
v, _ := col.ValueOf(bean)
v, err := col.ValueOf(bean)
if err != nil {
return
}
if v.CanSet() {
switch v.Type().Kind() {
case reflect.Struct: