diff --git a/lib/input/reader/mqtt.go b/lib/input/reader/mqtt.go index 63247e76e7..1627747dca 100644 --- a/lib/input/reader/mqtt.go +++ b/lib/input/reader/mqtt.go @@ -136,16 +136,11 @@ func (m *MQTT) msgHandler(c mqtt.Client, msg mqtt.Message) { // Read attempts to read a new message from an MQTT broker. func (m *MQTT) Read() (types.Message, error) { - if m.client == nil { - return nil, types.ErrNotConnected - } - select { case msg := <-m.msgChan: return types.NewMessage([][]byte{[]byte(msg.Payload())}), nil case <-m.interruptChan: } - return nil, types.ErrTypeClosed }