codec: RawMessage Marshal fix
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
53b40617e2
commit
3ace7657dc
@ -93,6 +93,8 @@ type RawMessage []byte
|
|||||||
func (m *RawMessage) MarshalJSON() ([]byte, error) {
|
func (m *RawMessage) MarshalJSON() ([]byte, error) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return []byte("null"), nil
|
return []byte("null"), nil
|
||||||
|
} else if len(*m) == 0 {
|
||||||
|
return []byte("null"), nil
|
||||||
}
|
}
|
||||||
return *m, nil
|
return *m, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user