mirror of https://github.com/go-gorm/gorm.git
Don't call method if value is nil
This commit is contained in:
parent
ef4299b398
commit
055bf79f8b
2
scope.go
2
scope.go
|
@ -177,7 +177,7 @@ func (scope *Scope) SetColumn(column interface{}, value interface{}) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (scope *Scope) CallMethod(name string, checkError bool) {
|
func (scope *Scope) CallMethod(name string, checkError bool) {
|
||||||
if scope.Value == nil && (!checkError || !scope.HasError()) {
|
if scope.Value == nil || (checkError && scope.HasError()) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue