This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit 4ce5c157b063d6d1d820c21e3669b605a301f55f Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Apr 2 12:15:54 2015 +0200 fix NPE if no catch on fishing operation --- .../service/genericformat/csv/OperationRow.java | 69 ++++++++++++---------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/csv/OperationRow.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/csv/OperationRow.java index c33e9c6..993bfb1 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/csv/OperationRow.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/csv/OperationRow.java @@ -180,40 +180,45 @@ public class OperationRow extends RowWithOperationContextSupport { CatchBatch batch = CatchBatchs.newCatchBatch(); - batch.setCatchTotalWeight(catchBatch.getCatchTotalWeight()); - batch.setCatchTotalComputedWeight(catchBatch.getCatchTotalComputedWeight()); - batch.setCatchTotalSortedTremisWeight(catchBatch.getCatchTotalSortedTremisWeight()); - batch.setCatchTotalSortedCarousselWeight(catchBatch.getCatchTotalSortedCarousselWeight()); - batch.setCatchTotalSortedComputedWeight(catchBatch.getCatchTotalSortedComputedWeight()); - batch.setCatchTotalUnsortedComputedWeight(catchBatch.getCatchTotalUnsortedComputedWeight()); - batch.setCatchTotalRejectedWeight(catchBatch.getCatchTotalRejectedWeight()); - batch.setCatchTotalRejectedComputedWeight(catchBatch.getCatchTotalRejectedComputedWeight()); - - batch.setSpeciesTotalComputedWeight(catchBatch.getSpeciesTotalComputedWeight()); - batch.setSpeciesTotalSortedWeight(catchBatch.getSpeciesTotalSortedWeight()); - batch.setSpeciesTotalSortedWeight(catchBatch.getSpeciesTotalSortedWeight()); - batch.setSpeciesTotalUnsortedComputedWeight(catchBatch.getSpeciesTotalUnsortedComputedWeight()); - batch.setSpeciesTotalSampleSortedComputedWeight(catchBatch.getSpeciesTotalSampleSortedComputedWeight()); - batch.setSpeciesTotalLivingNotItemizedWeight(catchBatch.getSpeciesTotalLivingNotItemizedWeight()); - batch.setSpeciesTotalLivingNotItemizedWeight(catchBatch.getSpeciesTotalLivingNotItemizedWeight()); - batch.setSpeciesTotalInertWeight(catchBatch.getSpeciesTotalInertWeight()); - batch.setSpeciesTotalInertComputedWeight(catchBatch.getSpeciesTotalInertComputedWeight()); - - batch.setBenthosTotalComputedWeight(catchBatch.getBenthosTotalComputedWeight()); - batch.setBenthosTotalSortedWeight(catchBatch.getBenthosTotalSortedWeight()); - batch.setBenthosTotalSortedComputedWeight(catchBatch.getBenthosTotalSortedComputedWeight()); - batch.setBenthosTotalUnsortedComputedWeight(catchBatch.getBenthosTotalUnsortedComputedWeight()); - batch.setBenthosTotalInertWeight(catchBatch.getBenthosTotalInertWeight()); - batch.setBenthosTotalInertComputedWeight(catchBatch.getBenthosTotalInertComputedWeight()); - batch.setBenthosTotalSampleSortedComputedWeight(catchBatch.getBenthosTotalSampleSortedComputedWeight()); - batch.setBenthosTotalLivingNotItemizedWeight(catchBatch.getBenthosTotalLivingNotItemizedWeight()); - batch.setBenthosTotalLivingNotItemizedComputedWeight(catchBatch.getBenthosTotalLivingNotItemizedComputedWeight()); - - batch.setMarineLitterTotalWeight(catchBatch.getMarineLitterTotalWeight()); - batch.setMarineLitterTotalComputedWeight(catchBatch.getMarineLitterTotalComputedWeight()); + if (catchBatch != null) { + + batch.setCatchTotalWeight(catchBatch.getCatchTotalWeight()); + batch.setCatchTotalComputedWeight(catchBatch.getCatchTotalComputedWeight()); + batch.setCatchTotalSortedTremisWeight(catchBatch.getCatchTotalSortedTremisWeight()); + batch.setCatchTotalSortedCarousselWeight(catchBatch.getCatchTotalSortedCarousselWeight()); + batch.setCatchTotalSortedComputedWeight(catchBatch.getCatchTotalSortedComputedWeight()); + batch.setCatchTotalUnsortedComputedWeight(catchBatch.getCatchTotalUnsortedComputedWeight()); + batch.setCatchTotalRejectedWeight(catchBatch.getCatchTotalRejectedWeight()); + batch.setCatchTotalRejectedComputedWeight(catchBatch.getCatchTotalRejectedComputedWeight()); + + batch.setSpeciesTotalComputedWeight(catchBatch.getSpeciesTotalComputedWeight()); + batch.setSpeciesTotalSortedWeight(catchBatch.getSpeciesTotalSortedWeight()); + batch.setSpeciesTotalSortedWeight(catchBatch.getSpeciesTotalSortedWeight()); + batch.setSpeciesTotalUnsortedComputedWeight(catchBatch.getSpeciesTotalUnsortedComputedWeight()); + batch.setSpeciesTotalSampleSortedComputedWeight(catchBatch.getSpeciesTotalSampleSortedComputedWeight()); + batch.setSpeciesTotalLivingNotItemizedWeight(catchBatch.getSpeciesTotalLivingNotItemizedWeight()); + batch.setSpeciesTotalLivingNotItemizedWeight(catchBatch.getSpeciesTotalLivingNotItemizedWeight()); + batch.setSpeciesTotalInertWeight(catchBatch.getSpeciesTotalInertWeight()); + batch.setSpeciesTotalInertComputedWeight(catchBatch.getSpeciesTotalInertComputedWeight()); + + batch.setBenthosTotalComputedWeight(catchBatch.getBenthosTotalComputedWeight()); + batch.setBenthosTotalSortedWeight(catchBatch.getBenthosTotalSortedWeight()); + batch.setBenthosTotalSortedComputedWeight(catchBatch.getBenthosTotalSortedComputedWeight()); + batch.setBenthosTotalUnsortedComputedWeight(catchBatch.getBenthosTotalUnsortedComputedWeight()); + batch.setBenthosTotalInertWeight(catchBatch.getBenthosTotalInertWeight()); + batch.setBenthosTotalInertComputedWeight(catchBatch.getBenthosTotalInertComputedWeight()); + batch.setBenthosTotalSampleSortedComputedWeight(catchBatch.getBenthosTotalSampleSortedComputedWeight()); + batch.setBenthosTotalLivingNotItemizedWeight(catchBatch.getBenthosTotalLivingNotItemizedWeight()); + batch.setBenthosTotalLivingNotItemizedComputedWeight(catchBatch.getBenthosTotalLivingNotItemizedComputedWeight()); + + batch.setMarineLitterTotalWeight(catchBatch.getMarineLitterTotalWeight()); + batch.setMarineLitterTotalComputedWeight(catchBatch.getMarineLitterTotalComputedWeight()); + + setCatchObjectId(catchBatch.getIdAsInt()); + + } this.catchBatch = batch; - setCatchObjectId(catchBatch.getIdAsInt()); } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.