Add handling for empty Jsonb to fix #1649

This commit is contained in:
daisy1754 2017-10-19 22:42:41 -07:00
parent 0a51f6cdc5
commit 5e639f25c3

View File

@ -63,6 +63,9 @@ type Jsonb struct {
// Value get value of Jsonb
func (j Jsonb) Value() (driver.Value, error) {
if len(j.RawMessage) == 0 {
return nil, nil
}
return j.MarshalJSON()
}