Handle model mix conversion with invalid sources

This commit is contained in:
elecpower
2021-11-07 14:50:09 +10:00
committed by Peter Feerick
parent 18e339e65c
commit 09159c2a03
+4 -2
View File
@@ -343,8 +343,10 @@ RawSource RawSource::convert(RadioDataConversionState & cstate)
if (type == SOURCE_TYPE_STICK) {
QStringList fromStickList(getStickList(cstate.fromBoard));
QStringList toStickList(getStickList(cstate.toBoard));
index = toStickList.indexOf(fromStickList.at(oldData.id));
// index set to -1 if no match found
if (oldData.id < fromStickList.count())
index = toStickList.indexOf(fromStickList.at(oldData.id));
else
index = -1;
// perform forced mapping
}