Combine validDecode if statement.

This commit is contained in:
Eric Severance 2024-12-16 20:32:08 -08:00
parent af5a6e82a1
commit de628f5649
No known key found for this signature in database
GPG Key ID: 340D1DA2A5A64A62

View File

@ -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;
}