fix bug in WithEventTracer

wrong nil check.
This commit is contained in:
vyzo 2020-03-11 02:44:57 +02:00
parent 39e65e8729
commit 06d72b93da
1 changed files with 1 additions and 1 deletions

View File

@ -361,7 +361,7 @@ func WithDiscovery(d discovery.Discovery, opts ...DiscoverOpt) Option {
// WithEventTracer provides a tracer for the pubsub system // WithEventTracer provides a tracer for the pubsub system
func WithEventTracer(tracer EventTracer) Option { func WithEventTracer(tracer EventTracer) Option {
return func(p *PubSub) error { return func(p *PubSub) error {
if tracer != nil { if p.tracer != nil {
p.tracer.tracer = tracer p.tracer.tracer = tracer
} else { } else {
p.tracer = &pubsubTracer{tracer: tracer, pid: p.host.ID(), msgID: p.msgID} p.tracer = &pubsubTracer{tracer: tracer, pid: p.host.ID(), msgID: p.msgID}