mirror of
https://github.com/Fishwaldo/qt-openzwave.git
synced 2025-07-20 03:58:20 +00:00
Check the data is valid before submitting to the model in SetValue
This commit is contained in:
parent
9260ae5a57
commit
fa938304ca
1 changed files with 8 additions and 0 deletions
|
@ -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";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue