fix(cpn): function switches induced crash (#5620)
This commit is contained in:
@@ -132,7 +132,7 @@ QString CustomFunctionData::funcToString(const AssignFunc func, const ModelData
|
||||
return tr("RGB leds");
|
||||
else if (func == FuncLCDtoVideo)
|
||||
return tr("LCD to Video");
|
||||
else if (func >= FuncPushCustomSwitch1 && func <= FuncPushCustomSwitchLast) {
|
||||
else if (func >= FuncPushCustomSwitch1 && func <= FuncPushCustomSwitchLast && Boards::getCapability(getCurrentBoard(), Board::FunctionSwitches)) {
|
||||
const int idx = Boards::getSwitchTypeOffset(Board::SWITCH_FUNC) + func - FuncPushCustomSwitch1 + 1;
|
||||
return tr("Push Custom Switch %1").arg(RawSource(SOURCE_TYPE_SWITCH, idx).toString(model));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user