From 055bf79f8bb07cf81706c25e5a7d18cd422c1d35 Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Tue, 21 Apr 2015 11:24:48 +0800 Subject: [PATCH] Don't call method if value is nil --- scope.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scope.go b/scope.go index f1733aa3..559b4daa 100644 --- a/scope.go +++ b/scope.go @@ -177,7 +177,7 @@ func (scope *Scope) SetColumn(column interface{}, value interface{}) error { } func (scope *Scope) CallMethod(name string, checkError bool) { - if scope.Value == nil && (!checkError || !scope.HasError()) { + if scope.Value == nil || (checkError && scope.HasError()) { return }