Author: dcosse Date: 2014-07-28 17:37:39 +0200 (Mon, 28 Jul 2014) New Revision: 3870 Url: http://forge.chorem.org/projects/lima/repository/revisions/3870 Log: refs #1032 gestion du cas ou il le master n'a pas de parents Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2014-07-28 15:33:53 UTC (rev 3869) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2014-07-28 15:37:39 UTC (rev 3870) @@ -26,6 +26,7 @@ package org.chorem.lima.business.ejb; import com.google.common.base.Function; +import com.google.common.collect.Lists; import com.google.common.collect.Maps; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; @@ -92,6 +93,9 @@ // valid that there are no duplicated financial statement. Collection<FinancialStatement> subFinancialStatements = masterfinancialStatementUpdate.getSubFinancialStatements(); + if (subFinancialStatements == null) { + subFinancialStatements = Lists.newArrayList(); + } Map indexedSubFinancialStatements = Maps.uniqueIndex(subFinancialStatements, GET_LABEL); if (indexedSubFinancialStatements.get(financialStatement.getLabel()) != null){ throw new AlreadyExistFinancialTransaction(financialStatement.getLabel(), masterfinancialStatementUpdate.getLabel());