diff --git a/.gitignore b/.gitignore index 482e34b1..39ae5706 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.idea .DS_Store *.swp *.swo diff --git a/orm/models_utils.go b/orm/models_utils.go index bf331fed..f58685d2 100644 --- a/orm/models_utils.go +++ b/orm/models_utils.go @@ -132,6 +132,9 @@ func getFieldType(val reflect.Value) (ft int, err error) { case reflect.String: ft = TypeCharField default: + if elm == nil { + panic(fmt.Errorf("%s is nil pointer, may be miss setting tag", val)) + } switch elm.Interface().(type) { case sql.NullInt64: ft = TypeBigIntegerField