Do not propagate a null response message back to the bus to prevent backends from breaking

This commit is contained in:
Fabio Manganiello 2019-01-02 09:29:27 +01:00
parent 09c1598829
commit 5b9c54748e

View file

@ -98,6 +98,8 @@ class MqttBackend(Backend):
def on_message(client, userdata, msg): def on_message(client, userdata, msg):
def response_thread(msg): def response_thread(msg):
response = self.get_message_response(msg) response = self.get_message_response(msg)
if not response:
return
response_topic = '{}/responses/{}'.format(self.topic, msg.id) response_topic = '{}/responses/{}'.format(self.topic, msg.id)
self.logger.info('Processing response on the MQTT topic {}: {}'. self.logger.info('Processing response on the MQTT topic {}: {}'.