Author: kmorin Date: 2013-06-10 10:17:28 +0200 (Mon, 10 Jun 2013) New Revision: 1085 Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1085 Log: fixes #2622 [CONTROLE] - Erreur blocante ?\195?\160 la validation Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/ValidateCruiseOperationsService.java Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/ValidateCruiseOperationsService.java =================================================================== --- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/ValidateCruiseOperationsService.java 2013-06-04 13:43:20 UTC (rev 1084) +++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/ValidateCruiseOperationsService.java 2013-06-10 08:17:28 UTC (rev 1085) @@ -314,27 +314,31 @@ Map<String, List<String>> warningMap = Maps.newHashMap(); Decorator<Species> speciesDecorator = decoratorService.getDecoratorByType(Species.class); - for (SpeciesBatch batch : rootSpeciesBatch.getChildren()) { - if (isSpeciesBatchInvalid(batch, protocol)) { - String species = speciesDecorator.toString(batch.getSpecies()); - String categoryValue = decoratorService.getDecorator(batch.getSampleCategoryValue()) - .toString(batch.getSampleCategoryValue()); - warningMap.put("species", - Lists.newArrayList(_("tutti.validator.warning.species.protocolNotRespected", - species, categoryValue))); - break; + if (rootSpeciesBatch != null) { + for (SpeciesBatch batch : rootSpeciesBatch.getChildren()) { + if (isSpeciesBatchInvalid(batch, protocol)) { + String species = speciesDecorator.toString(batch.getSpecies()); + String categoryValue = decoratorService.getDecorator(batch.getSampleCategoryValue()) + .toString(batch.getSampleCategoryValue()); + warningMap.put("species", + Lists.newArrayList(_("tutti.validator.warning.species.protocolNotRespected", + species, categoryValue))); + break; + } } } - for (BenthosBatch batch : rootBenthosBatch.getChildren()) { - if (isBenthosBatchInvalid(batch, protocol)) { - String species = speciesDecorator.toString(batch.getSpecies()); - String categoryValue = decoratorService.getDecorator(batch.getSampleCategoryValue()) - .toString(batch.getSampleCategoryValue()); - warningMap.put("benthos", - Lists.newArrayList(_("tutti.validator.warning.benthos.protocolNotRespected", - species, categoryValue))); - break; + if (rootBenthosBatch != null) { + for (BenthosBatch batch : rootBenthosBatch.getChildren()) { + if (isBenthosBatchInvalid(batch, protocol)) { + String species = speciesDecorator.toString(batch.getSpecies()); + String categoryValue = decoratorService.getDecorator(batch.getSampleCategoryValue()) + .toString(batch.getSampleCategoryValue()); + warningMap.put("benthos", + Lists.newArrayList(_("tutti.validator.warning.benthos.protocolNotRespected", + species, categoryValue))); + break; + } } }