From 99c03a2b9cd545b237024f3046312eee520b279a Mon Sep 17 00:00:00 2001 From: astaxie Date: Fri, 8 Aug 2014 13:16:51 +0800 Subject: [PATCH] fix the nil judge --- orm/models_utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orm/models_utils.go b/orm/models_utils.go index e7e94a42..b682040b 100644 --- a/orm/models_utils.go +++ b/orm/models_utils.go @@ -131,7 +131,7 @@ func getFieldType(val reflect.Value) (ft int, err error) { case reflect.String: ft = TypeCharField default: - if elm.IsNil() { + if elm.Interface() == nil { panic(fmt.Errorf("%s is nil pointer, may be miss setting tag", val)) } switch elm.Interface().(type) {