diff --git a/codec/proto/proto.go b/codec/proto/proto.go index 03ed329c..c4375ec2 100644 --- a/codec/proto/proto.go +++ b/codec/proto/proto.go @@ -33,6 +33,10 @@ func (c *Codec) ReadBody(b interface{}) error { } func (c *Codec) Write(m *codec.Message, b interface{}) error { + if b == nil { + // Nothing to write + return nil + } p, ok := b.(proto.Message) if !ok { return codec.ErrInvalidMessage