1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-18 08:54:15 +01:00

Bugfix: in some rare cases, the GCS could crash if the Scope Gadget configuration contained a non-existing UAVObject name.

This commit is contained in:
elafargue 2011-05-03 10:54:38 +02:00
parent 46566d05e8
commit d4a021242c

View File

@ -183,6 +183,9 @@ void ScopeGadgetOptionsPage::on_cmbUAVObjects_currentIndexChanged(QString val)
UAVObjectManager *objManager = pm->getObject<UAVObjectManager>();
UAVDataObject* obj = dynamic_cast<UAVDataObject*>( objManager->getObject(val) );
if (obj == NULL)
return; // Rare case: the config contained a UAVObject name which does not exist anymore.
QList<UAVObjectField*> fieldList = obj->getFields();
foreach (UAVObjectField* field, fieldList) {
if(field->getType() == UAVObjectField::STRING || field->getType() == UAVObjectField::ENUM )