Fix scan nil primitive type slice

This commit is contained in:
mlaflamm 2021-09-14 17:18:56 -04:00 committed by go-jet
parent b31464e491
commit fee77b695a
2 changed files with 12 additions and 8 deletions

View file

@ -214,9 +214,9 @@ func mapRowToBaseTypeSlice(scanContext *scanContext, slicePtrValue reflect.Value
}
rowElemPtr := scanContext.rowElemValuePtr(index)
if !rowElemPtr.IsNil() {
if rowElemPtr != nil && !rowElemPtr.IsNil() {
updated = true
err = appendElemToSlice(slicePtrValue, rowElemPtr)
err = appendElemToSlice(slicePtrValue, *rowElemPtr)
if err != nil {
return
}