1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

LP-402 gcs: better report invalid UAVO Enum errors

This commit is contained in:
Philippe Renon 2017-01-15 22:35:55 +01:00
parent 25998f668a
commit 63733639de

View File

@ -1024,7 +1024,7 @@ QVariant UAVObjectField::getValue(quint32 index)
quint8 tmpenum;
memcpy(&tmpenum, &data[offset + numBytesPerElement * index], numBytesPerElement);
if (tmpenum >= options.length()) {
qDebug() << "Invalid value for" << name;
qDebug() << "Invalid enum" << tmpenum << "for field" << (obj->getName() + ":" + name + "[" + elementNames[index] + "]");
tmpenum = 0;
}
return QVariant(options[tmpenum]);