Simpler #634, always use the first choice when out of bounds

This commit is contained in:
vsonnier 2018-03-24 07:06:27 +01:00
parent 4cd8735014
commit 120d394f01
1 changed files with 2 additions and 6 deletions

View File

@ -502,16 +502,12 @@ std::string SDRDevicesDialog::getSelectedChoiceOption(wxPGProperty* prop, const
if (choiceIndex >= 0 && choiceIndex < arg.options.size()) {
//normal selection
optionName = arg.options[choiceIndex];
} else if (choiceIndex >= arg.options.size()) {
//choose the last one of the list:
optionName = arg.options[arg.options.size() - 1];
prop->SetChoiceSelection(arg.options.size() - 1);
} else if (choiceIndex < 0) {
} else {
//choose the first one of the list:
optionName = arg.options[0];
prop->SetChoiceSelection(0);
}
}
}
return optionName;
}