fineract-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FINERACT-52) Null value not handled in "ClientWritePlatformServiceJpaRepositoryImpl.CloseClient" date comparison
Date Tue, 02 Aug 2016 14:10:20 GMT

    [ https://issues.apache.org/jira/browse/FINERACT-52?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15404042#comment-15404042
] 

ASF GitHub Bot commented on FINERACT-52:
----------------------------------------

Github user emmanuelnnaa commented on a diff in the pull request:

    https://github.com/apache/incubator-fineract/pull/176#discussion_r73161469
  
    --- Diff: fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java
---
    @@ -631,7 +631,7 @@ public CommandProcessingResult closeClient(final Long clientId, final
JsonComman
                     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)) {
    --- End diff --
    
    @nazeer1100126 
    There's no guarantee that the "activationDate" property of all clients will have a value
other than NULL or an empty string. During migration of a new tenant, some data might be missed.
Moreover, it is good practice to carry out such checks to avoid null pointer exceptions.


> Null value not handled in "ClientWritePlatformServiceJpaRepositoryImpl.CloseClient" date
comparison
> ---------------------------------------------------------------------------------------------------
>
>                 Key: FINERACT-52
>                 URL: https://issues.apache.org/jira/browse/FINERACT-52
>             Project: Apache Fineract
>          Issue Type: Improvement
>            Reporter: Emmanuel Nnaa
>            Assignee: Markus Geiss
>            Priority: Minor
>
> The "client.getActivationLocalDate().isAfter(closureDate)" date comparison will throw
a null pointer exception if "client.getActivationLocalDate()" is null.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message