diff --git a/decimal.go b/decimal.go index 5a404c8..e514561 100644 --- a/decimal.go +++ b/decimal.go @@ -1829,6 +1829,11 @@ func (d Decimal) MarshalBinary() (data []byte, err error) { // Scan implements the sql.Scanner interface for database deserialization. func (d *Decimal) Scan(value interface{}) error { + if value == nil { + d = nil + return nil + } + // first try to see if the data is stored in database as a Numeric datatype switch v := value.(type) {