fix(cpn): Application crash when editing radio settings (#3978)
This commit is contained in:
@@ -326,15 +326,14 @@ bool RawSource::isAvailable(const ModelData * const model, const GeneralSettings
|
||||
if (!model || index >= b.getCapability(Board::FunctionSwitches))
|
||||
return false;
|
||||
|
||||
if (type == SOURCE_TYPE_SPECIAL) {
|
||||
if (index >= SOURCE_TYPE_SPECIAL_FIRST_RESERVED && index <= SOURCE_TYPE_SPECIAL_LAST_RESERVED)
|
||||
if (type == SOURCE_TYPE_SPECIAL && index >= SOURCE_TYPE_SPECIAL_FIRST_RESERVED && index <= SOURCE_TYPE_SPECIAL_LAST_RESERVED)
|
||||
return false;
|
||||
else if (index >= SOURCE_TYPE_SPECIAL_FIRST_TIMER && index <= SOURCE_TYPE_SPECIAL_LAST_TIMER &&
|
||||
model->timers[index - SOURCE_TYPE_SPECIAL_FIRST_TIMER].isModeOff())
|
||||
return false;
|
||||
}
|
||||
|
||||
if (model) {
|
||||
if (type == SOURCE_TYPE_SPECIAL && index >= SOURCE_TYPE_SPECIAL_FIRST_TIMER && index <= SOURCE_TYPE_SPECIAL_LAST_TIMER &&
|
||||
model->timers[index - SOURCE_TYPE_SPECIAL_FIRST_TIMER].isModeOff())
|
||||
return false;
|
||||
|
||||
if (type == SOURCE_TYPE_FUNCTIONSWITCH && !model->isFunctionSwitchSourceAllowed(index))
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user