Skip to content

Commit

Permalink
Fixed bug where config files could not be updated
Browse files Browse the repository at this point in the history
The bug was caused by the ConfigFileUpdater class not being able to
update config file that version was higher than the target version of
the beginning steps in the update process. The updater would incorrectly
indicate failure when the update step was for a older config file
version.
  • Loading branch information
TomKimsey committed Dec 21, 2023
1 parent 7f094eb commit 6b70d53
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,16 @@ public boolean updateConfig() {
for (int i = 0; i < steps.size(); i++) {
ConfigFileUpdateStep step = (ConfigFileUpdateStep) steps.get(i);

if (success && step.isCompatibleWithVersion(getConfigFileVersion())) {
success = success && step.updateConfig(config);
if (step.isCompatibleWithVersion(getConfigFileVersion())) {
success = step.updateConfig(config);
if (success) {
success = setConfigFileVersion(step.getStepVersion());
} else {
// The step is compatible with the current version, but failed to update the config
break;
}
} else {
success = false;
break;
}
}

Expand Down

0 comments on commit 6b70d53

Please sign in to comment.