Tony CHEMIT pushed to branch develop at ultreiaio / ird-t3
Commits:
-
07250611
by Tony CHEMIT at 2018-03-20T09:27:44Z
1 changed file:
Changes:
| ... | ... | @@ -50,8 +50,12 @@ public class ConvertCatchesWeightCategoriesConfigureAction extends AbstractLevel |
| 50 | 50 |
protected void loadDefaultConfiguration(ConvertCatchesWeightCategoriesConfiguration config) {
|
| 51 | 51 |
super.loadDefaultConfiguration(config);
|
| 52 | 52 |
List<String> versions = dao.findAll().stream().map(WeightCategoryLogBookConversion::getVersion).distinct().collect(Collectors.toCollection(LinkedList::new));
|
| 53 |
+ if (versions.isEmpty()) {
|
|
| 54 |
+ throw new IllegalStateException("can't find a version of weight category logBook conversion in database");
|
|
| 55 |
+ }
|
|
| 56 |
+ String defaultVersion = versions.get(0);
|
|
| 53 | 57 |
versions.add(ConvertCatchesWeightCategoriesConfiguration.LEGACY_VERSION);
|
| 54 | 58 |
config.setVersions(versions);
|
| 55 |
- config.setVersion(ConvertCatchesWeightCategoriesConfiguration.LEGACY_VERSION);
|
|
| 59 |
+ config.setVersion(defaultVersion);
|
|
| 56 | 60 |
}
|
| 57 | 61 |
}
|