Skip to content

Commit

Permalink
Small config file integrity check fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Dwyriel committed Nov 17, 2022
1 parent 1312240 commit d17bbd9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/presetandconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@ void ConfigManager::Save(int index){

void ConfigManager::CheckFilesIntegrity(){
bool configChanged = false;
if(presetsAndConfig.CurrentPresetIndex >= presetsAndConfig.Presets.size()){
if(!presetsAndConfig.Presets.isEmpty() && presetsAndConfig.CurrentPresetIndex >= presetsAndConfig.Presets.size()){
presetsAndConfig.CurrentPresetIndex = presetsAndConfig.Presets.size() - 1;
configChanged = true;
}
if(presetsAndConfig.CurrentPresetIndex < 0){
presetsAndConfig.CurrentPresetIndex = 0;
configChanged = true;
}
if(presetsAndConfig.Presets.isEmpty()){
if(presetsAndConfig.Presets.isEmpty() && presetsAndConfig.CurrentPresetIndex != 0){
presetsAndConfig.CurrentPresetIndex = 0;
configChanged = true;
}
Expand Down

0 comments on commit d17bbd9

Please sign in to comment.