1
0
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:
James Cotton 2011-05-05 01:23:43 -05:00
parent 3d3a4e9572
commit 80d4589743

View File

@ -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;
}