Don't call method if value is nil

This commit is contained in:
Jinzhu 2015-04-21 11:24:48 +08:00
parent ef4299b398
commit 055bf79f8b
1 changed files with 1 additions and 1 deletions

View File

@ -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
} }