Skip to content

Commit 2f785c1

Browse files
committed
fix nil panic in NeedsArrayWrappingForArg
1 parent a7024e3 commit 2f785c1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

impl/arrays.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ func NeedsArrayWrappingForScanning(v reflect.Value) bool {
3131
}
3232

3333
func NeedsArrayWrappingForArg(arg any) bool {
34+
if arg == nil {
35+
return false
36+
}
3437
t := reflect.TypeOf(arg)
3538
switch t.Kind() {
3639
case reflect.Slice:

0 commit comments

Comments
 (0)