add nil check
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
322b8cee45
commit
38cf770f2e
2
json.go
2
json.go
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user