mirror of
https://github.com/jackc/pgx.git
synced 2025-05-31 11:42:24 +00:00
reflect.TypeOf can return nil. Check before using
https://github.com/jackc/pgx/issues/1331
This commit is contained in:
parent
aff180b192
commit
f2e7c8144d
@ -1432,7 +1432,7 @@ func TryWrapDerefPointerEncodePlan(value any) (plan WrappedEncodePlanNextSetter,
|
||||
return nil, nil, false
|
||||
}
|
||||
|
||||
if valueType := reflect.TypeOf(value); valueType.Kind() == reflect.Ptr {
|
||||
if valueType := reflect.TypeOf(value); valueType != nil && valueType.Kind() == reflect.Ptr {
|
||||
return &derefPointerEncodePlan{}, reflect.New(valueType.Elem()).Elem().Interface(), true
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user