Skip to content

Commit

Permalink
kafka: bugfix possible nil pointer error on close (#3383)
Browse files Browse the repository at this point in the history
Signed-off-by: Fabian Martinez <46371672+famarting@users.noreply.github.com>
  • Loading branch information
famarting committed Mar 22, 2024
1 parent b9c12df commit a9548a7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion common/component/kafka/kafka.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,9 @@ func (k *Kafka) Close() error {
}
k.subscribeLock.Unlock()

errs[1] = k.cg.Close()
if k.cg != nil {
errs[1] = k.cg.Close()
}
}

return errors.Join(errs...)
Expand Down

0 comments on commit a9548a7

Please sign in to comment.