dialect/sql: do not call inner Scan for nil values in sql.NullScanner (#1771)

This commit is contained in:
Ruben de Vries
2021-07-27 11:05:22 +02:00
committed by GitHub
parent 9de519d027
commit 1586d50f94

View File

@@ -160,5 +160,8 @@ type NullScanner struct {
// Scan implements the Scanner interface.
func (n *NullScanner) Scan(value interface{}) error {
n.Valid = value != nil
return n.S.Scan(value)
if n.Valid {
return n.S.Scan(value)
}
return nil
}