1
0
mirror of https://github.com/volatiletech/authboss.git synced 2025-09-16 09:06:20 +02:00

Fix func Bind not handling sql.Nullstring from nil. Closes #110.

Also fixes behavior for sql.NullInt64, sql.NullFloat64, sql.NullBool.
This commit is contained in:
Paul Desmond Parker
2017-01-09 15:34:00 +08:00
parent f3eba05359
commit 91403280ec

View File

@@ -293,9 +293,11 @@ func (a Attributes) Bind(strct interface{}, ignoreMissing bool) error {
return errors.New("Bind: Was a scanner without a Scan method")
}
rvals := method.Call([]reflect.Value{reflect.ValueOf(v)})
if err, ok := rvals[0].Interface().(error); ok && err != nil {
return err
if v != nil {
rvals := method.Call([]reflect.Value{reflect.ValueOf(v)})
if err, ok := rvals[0].Interface().(error); ok && err != nil {
return err
}
}
continue