Tony CHEMIT pushed to branch develop at ultreiaio / ird-t3 Commits: 07250611 by Tony CHEMIT at 2018-03-20T09:27:44Z [N0.3] Conversion des catégories logbook - rendre générique la codification des catégories inconnues - utilisation version par défaut (See #287) - - - - - 1 changed file: - t3-web/src/main/java/fr/ird/t3/web/actions/data/level0/ConvertCatchesWeightCategoriesConfigureAction.java Changes: ===================================== t3-web/src/main/java/fr/ird/t3/web/actions/data/level0/ConvertCatchesWeightCategoriesConfigureAction.java ===================================== --- a/t3-web/src/main/java/fr/ird/t3/web/actions/data/level0/ConvertCatchesWeightCategoriesConfigureAction.java +++ b/t3-web/src/main/java/fr/ird/t3/web/actions/data/level0/ConvertCatchesWeightCategoriesConfigureAction.java @@ -50,8 +50,12 @@ public class ConvertCatchesWeightCategoriesConfigureAction extends AbstractLevel protected void loadDefaultConfiguration(ConvertCatchesWeightCategoriesConfiguration config) { super.loadDefaultConfiguration(config); List<String> versions = dao.findAll().stream().map(WeightCategoryLogBookConversion::getVersion).distinct().collect(Collectors.toCollection(LinkedList::new)); + if (versions.isEmpty()) { + throw new IllegalStateException("can't find a version of weight category logBook conversion in database"); + } + String defaultVersion = versions.get(0); versions.add(ConvertCatchesWeightCategoriesConfiguration.LEGACY_VERSION); config.setVersions(versions); - config.setVersion(ConvertCatchesWeightCategoriesConfiguration.LEGACY_VERSION); + config.setVersion(defaultVersion); } } View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/commit/0725061177b78eb4ca3fcbbaa2312ca25... --- View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/commit/0725061177b78eb4ca3fcbbaa2312ca25... You're receiving this email because of your account on gitlab.com.