1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-23 00:00:50 +00:00

Merge pull request #728 from nizsheanez/null_pointer_panic_improve

[orm] improve null pointer panic message
This commit is contained in:
astaxie 2014-08-08 09:01:51 +08:00
commit 77e1f26dd4
2 changed files with 4 additions and 0 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
.idea
.DS_Store
*.swp
*.swo

View File

@ -131,6 +131,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