From 38cf770f2eb08170cc12309ff1681e79e84ed102 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Wed, 25 Nov 2020 12:22:51 +0300 Subject: [PATCH] add nil check Signed-off-by: Vasiliy Tolstov --- json.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/json.go b/json.go index 2b186cc..d0d00bc 100644 --- a/json.go +++ b/json.go @@ -24,7 +24,7 @@ func (c *jsonCodec) Marshal(b interface{}) ([]byte, error) { } func (c *jsonCodec) Unmarshal(b []byte, v interface{}) error { - if b == nil { + if b == nil || v == nil { return nil } switch m := v.(type) {