check if kafka producer is connected (#11578)

fixes #11576
master
Klaus Post 4 years ago committed by GitHub
parent c5b2a8441b
commit 90abea5b7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      pkg/event/target/kafka.go

@ -160,6 +160,9 @@ func (target *KafkaTarget) Save(eventData event.Event) error {
// send - sends an event to the kafka. // send - sends an event to the kafka.
func (target *KafkaTarget) send(eventData event.Event) error { func (target *KafkaTarget) send(eventData event.Event) error {
if target.producer == nil {
return errNotConnected
}
objectName, err := url.QueryUnescape(eventData.S3.Object.Key) objectName, err := url.QueryUnescape(eventData.S3.Object.Key)
if err != nil { if err != nil {
return err return err

Loading…
Cancel
Save