From ef22bd65ea5b80d82332006a07ac5e5063048589 Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Sat, 17 Feb 2024 01:10:26 +0100 Subject: [PATCH] mqtt: Allow for empty/missing messages. --- aqhome/mqtt/msg_mqtt_publish.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aqhome/mqtt/msg_mqtt_publish.c b/aqhome/mqtt/msg_mqtt_publish.c index 245d3e5..05804bd 100644 --- a/aqhome/mqtt/msg_mqtt_publish.c +++ b/aqhome/mqtt/msg_mqtt_publish.c @@ -25,7 +25,7 @@ static int _dumpPayload(uint8_t flags, const uint8_t *payloadPtr, uint32_t paylo GWEN_MSG *AQH_PublishMqttMsg_new(uint8_t flags, uint16_t packetId, const char *sTopic, const uint8_t *messagePtr, uint32_t messageLen) { - if (sTopic && *sTopic && messagePtr && messageLen) { + if (sTopic && *sTopic) { GWEN_MSG *msg; GWEN_BUFFER *buf; @@ -47,7 +47,7 @@ GWEN_MSG *AQH_PublishMqttMsg_new(uint8_t flags, uint16_t packetId, const char *s return msg; } else { - DBG_ERROR(AQH_LOGDOMAIN, "Missing topic or message"); + DBG_ERROR(AQH_LOGDOMAIN, "Missing topic"); return NULL; } }