commit for FINERACT-52 (Null value not handled in 'ClientWritePlatformServiceJpaRepositoryImpl.CloseClient' date comparison)

This commit is contained in:
Emmanuel Nnaa
2016-07-18 12:52:16 +02:00
parent 5ac0da03d3
commit d8f14a662a
@@ -631,7 +631,7 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP
throw new InvalidClientStateTransitionException("close", "is.under.transfer", errorMessage);
}
if (client.isNotPending() && client.getActivationLocalDate().isAfter(closureDate)) {
if (client.isNotPending() && client.getActivationLocalDate() != null && client.getActivationLocalDate().isAfter(closureDate)) {
final String errorMessage = "The client closureDate cannot be before the client ActivationDate.";
throw new InvalidClientStateTransitionException("close", "date.cannot.before.client.actvation.date", errorMessage,
closureDate, client.getActivationLocalDate());