Skip to content

Commit

Permalink
missing nil check for grpc WaitGroup
Browse files Browse the repository at this point in the history
  • Loading branch information
xpunch committed Jun 17, 2019
1 parent 7a87ae0 commit 363fb55
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions server/grpc/subscriber.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,13 @@ func (g *grpcServer) createSubHandler(sb *subscriber, opts server.Options) broke
fn = opts.SubWrappers[i-1](fn)
}

g.wg.Add(1)
if g.wg != nil {
g.wg.Add(1)
}
go func() {
defer g.wg.Done()
if g.wg != nil {
defer g.wg.Done()
}
fn(ctx, &rpcMessage{
topic: sb.topic,
contentType: ct,
Expand Down

0 comments on commit 363fb55

Please sign in to comment.