Skip to content

Commit d7c6e3d

Browse files
committed
check nil ctx
1 parent 8aa2ec4 commit d7c6e3d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pulsar/internal/connection.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,10 @@ func (c *connection) WriteData(ctx context.Context, data Buffer) {
493493

494494
func (c *connection) internalWriteData(ctx context.Context, data Buffer) {
495495
c.log.Debug("Write data: ", data.ReadableBytes())
496+
if ctx == nil {
497+
return
498+
}
499+
496500
select {
497501
case <-ctx.Done():
498502
return

0 commit comments

Comments
 (0)