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:
@@ -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
|
||||
|
Reference in New Issue
Block a user