From de628f5649e59cd4a1f2cd18c8a9085d916d8305 Mon Sep 17 00:00:00 2001 From: Eric Severance Date: Mon, 16 Dec 2024 20:32:08 -0800 Subject: [PATCH] Combine validDecode if statement. --- src/mqtt/MQTT.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/mqtt/MQTT.cpp b/src/mqtt/MQTT.cpp index 9eed4dac8..d55f6af11 100644 --- a/src/mqtt/MQTT.cpp +++ b/src/mqtt/MQTT.cpp @@ -56,11 +56,7 @@ struct DecodedServiceEnvelope : public meshtastic_ServiceEnvelope { inline void onReceiveProto(char *topic, byte *payload, size_t length) { const DecodedServiceEnvelope e(payload, length); - if (!e.validDecode) { - LOG_ERROR("Invalid MQTT service envelope, topic %s, len %u!", topic, length); - return; - } - if (e.channel_id == NULL || e.gateway_id == NULL || e.packet == NULL) { + if (!e.validDecode || e.channel_id == NULL || e.gateway_id == NULL || e.packet == NULL) { LOG_ERROR("Invalid MQTT service envelope, topic %s, len %u!", topic, length); return; }