fix double pointer for nats unmarshal

This commit is contained in:
Asim Aslam 2016-12-06 20:35:00 +00:00 committed by Vasiliy Tolstov
parent f8714d4cd9
commit 2f94cdd04c

View File

@ -117,11 +117,11 @@ func (n *nbroker) Subscribe(topic string, handler broker.Handler, opts ...broker
} }
fn := func(msg *nats.Msg) { fn := func(msg *nats.Msg) {
var m *broker.Message var m broker.Message
if err := n.opts.Codec.Unmarshal(msg.Data, &m); err != nil { if err := n.opts.Codec.Unmarshal(msg.Data, &m); err != nil {
return return
} }
handler(&publication{m: m, t: topic}) handler(&publication{m: &m, t: topic})
} }
var sub *nats.Subscription var sub *nats.Subscription