Fixed segfault when saving setup with no models defined [Horus]

This commit is contained in:
Damjan Adamic
2017-01-27 09:32:43 +01:00
parent 7d849e1c4c
commit 16960cb9a0
+3 -1
View File
@@ -36,7 +36,9 @@ void GeneralSettings::convert(Board::Type before, Board::Type after)
void RadioData::setCurrentModel(unsigned int index)
{
generalSettings.currModelIndex = index;
strcpy(generalSettings.currModelFilename, models[index].filename);
if (index < models.size()) {
strcpy(generalSettings.currModelFilename, models[index].filename);
}
}
void RadioData::fixModelFilename(unsigned int index)