mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
Ground/UAVObjectBrowser: Don't crash for undefined enum values, just say
invalid git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2244 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
af99c31a61
commit
50b5d0d289
@ -81,7 +81,12 @@ public:
|
||||
setChanged(tmpValIndex != value);
|
||||
TreeItem::setData(value, column);
|
||||
}
|
||||
QString enumOptions(int index) { return m_enumOptions.at(index); }
|
||||
QString enumOptions(int index) {
|
||||
if((index < 0) || (index >= m_enumOptions.length())) {
|
||||
return QString("Invalid Value (") + QString().setNum(index) + QString(")");
|
||||
}
|
||||
return m_enumOptions.at(index);
|
||||
}
|
||||
void apply() {
|
||||
int value = data(dataColumn).toInt();
|
||||
QStringList options = m_field->getOptions();
|
||||
|
Loading…
x
Reference in New Issue
Block a user