Fix to refer invalid memory access on helpers.go

This commit is contained in:
Shintaro Kaneko 2015-03-06 12:37:05 +00:00
parent 466b49772b
commit 74a9355457
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) { 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() { if v.CanSet() {
switch v.Type().Kind() { switch v.Type().Kind() {
case reflect.Struct: case reflect.Struct: