Check the data is valid before submitting to the model in SetValue

This commit is contained in:
Justin Hammond 2019-11-06 17:22:39 +08:00
parent 9260ae5a57
commit fa938304ca

View file

@ -161,6 +161,14 @@ bool MqttCommand_SetValue::processMessage(QJsonDocument msg) {
break;
}
}
if (data.isNull()) {
qCWarning(ozwmcsv) << "Data is undefined for setValue... Json Conversion Failed?";
QJsonObject js;
js["status"] = "failed";
js["Error"] = "JSON Conversion Failed";
emit sendCommandUpdate(GetCommand(), js);
return false;
}
if (this->setValue(vidKey, data)) {
QJsonObject js;
js["status"] = "ok";