From 7e8f3ef103e206cbc3e8315f4fe9c12fbe6e917e Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Wed, 1 Jan 2020 21:56:29 +0000 Subject: [PATCH] don't panic on nil --- codec.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/codec.go b/codec.go index 356f8e8..a1d4a65 100644 --- a/codec.go +++ b/codec.go @@ -64,6 +64,9 @@ func (w wrapCodec) Unmarshal(data []byte, v interface{}) error { b.Data = data return nil } + if v == nil { + return nil + } return w.Codec.Unmarshal(data, v) }