mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-29 07:24:13 +01:00
Add assert when enum set to invalid value
This commit is contained in:
parent
3d3a4e9572
commit
80d4589743
@ -552,6 +552,7 @@ void UAVObjectField::setValue(const QVariant& value, quint32 index)
|
||||
case ENUM:
|
||||
{
|
||||
qint8 tmpenum = options.indexOf( value.toString() );
|
||||
Q_ASSERT(tmpenum >= 0); // To catch any programming errors where we set invalid values
|
||||
memcpy(&data[offset + numBytesPerElement*index], &tmpenum, numBytesPerElement);
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user