mirror of
https://github.com/astaxie/beego.git
synced 2024-11-26 10:01:28 +00:00
Merge pull request #728 from nizsheanez/null_pointer_panic_improve
[orm] improve null pointer panic message
This commit is contained in:
commit
77e1f26dd4
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
|
.idea
|
||||||
.DS_Store
|
.DS_Store
|
||||||
*.swp
|
*.swp
|
||||||
*.swo
|
*.swo
|
||||||
|
@ -131,6 +131,9 @@ func getFieldType(val reflect.Value) (ft int, err error) {
|
|||||||
case reflect.String:
|
case reflect.String:
|
||||||
ft = TypeCharField
|
ft = TypeCharField
|
||||||
default:
|
default:
|
||||||
|
if elm == nil {
|
||||||
|
panic(fmt.Errorf("%s is nil pointer, may be miss setting tag", val))
|
||||||
|
}
|
||||||
switch elm.Interface().(type) {
|
switch elm.Interface().(type) {
|
||||||
case sql.NullInt64:
|
case sql.NullInt64:
|
||||||
ft = TypeBigIntegerField
|
ft = TypeBigIntegerField
|
||||||
|
Loading…
Reference in New Issue
Block a user