Merge pull request #1101 from droloff/fix-npe
check payload to avoid npe
This commit is contained in:
commit
a8c530a3a9
@ -56,6 +56,12 @@ void onMqttMessage(char* topic, char* payload, AsyncMqttClientMessageProperties
|
||||
|
||||
DEBUG_PRINT("MQTT msg: ");
|
||||
DEBUG_PRINTLN(topic);
|
||||
|
||||
// paranoia check to avoid npe if no payload
|
||||
if (payload==nullptr) {
|
||||
DEBUG_PRINTLN("no payload -> leave");
|
||||
return;
|
||||
}
|
||||
DEBUG_PRINTLN(payload);
|
||||
|
||||
//no need to check the topic because we only get topics we are subscribed to
|
||||
|
Loading…
Reference in New Issue
Block a user