From 09159c2a0312b53277e9ae0c9ff45030e04d6ab0 Mon Sep 17 00:00:00 2001 From: elecpower Date: Sun, 7 Nov 2021 07:03:33 +1100 Subject: [PATCH] Handle model mix conversion with invalid sources --- companion/src/firmwares/rawsource.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/companion/src/firmwares/rawsource.cpp b/companion/src/firmwares/rawsource.cpp index eaa651b6c..98fa363d4 100644 --- a/companion/src/firmwares/rawsource.cpp +++ b/companion/src/firmwares/rawsource.cpp @@ -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 }