add nil check

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2020-11-25 12:22:51 +03:00
parent 322b8cee45
commit 38cf770f2e

View File

@ -24,7 +24,7 @@ func (c *jsonCodec) Marshal(b interface{}) ([]byte, error) {
} }
func (c *jsonCodec) Unmarshal(b []byte, v interface{}) error { func (c *jsonCodec) Unmarshal(b []byte, v interface{}) error {
if b == nil { if b == nil || v == nil {
return nil return nil
} }
switch m := v.(type) { switch m := v.(type) {