Skip to content

Commit 854f833

Browse files
committed
erase the type when storing nil []byte into map
1 parent a04d133 commit 854f833

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

stmt.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,16 @@ func (s *Stmt) MapInto(m map[string]any) error {
225225
m[name] = s.ColumnDouble(i)
226226
break
227227
case C.SQLITE_BLOB:
228-
var err error
229-
m[name], err = s.ColumnBytes(i)
228+
value, err := s.ColumnBytes(i)
230229
if err != nil {
231230
return err
232231
}
232+
// erase the type
233+
if value == nil {
234+
m[name] = nil
235+
} else {
236+
m[name] = value
237+
}
233238
break
234239
}
235240
}

0 commit comments

Comments
 (0)