mirror of
https://github.com/opentx/opentx.git
synced 2025-07-23 16:25:16 +03:00
[Companion] Fix another possible crash during model conversions (divide by zero).
This commit is contained in:
parent
629d82fe27
commit
ee50096754
1 changed files with 2 additions and 0 deletions
|
@ -699,6 +699,8 @@ QString RawSwitch::toString(Board::Type board, const GeneralSettings * const gen
|
|||
return QObject::tr("L%1").arg(index);
|
||||
|
||||
case SWITCH_TYPE_MULTIPOS_POT:
|
||||
if (!getCurrentFirmware()->getCapability(MultiposPotsPositions))
|
||||
return QObject::tr("???");
|
||||
qr = div(index - 1, getCurrentFirmware()->getCapability(MultiposPotsPositions));
|
||||
if (generalSettings && qr.quot < (int)DIM(generalSettings->potConfig))
|
||||
swName = QString(generalSettings->potName[qr.quot]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue