mirror of
https://github.com/astaxie/beego.git
synced 2025-06-12 00:30:40 +00:00
improve null pointer panic message
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user