This is an automated email from the ASF dual-hosted git repository.

victorromero pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git


The following commit(s) were added to refs/heads/develop by this push:
     new 13d587a95 Allow disbursementDataArray empty instead of null (#2499)
13d587a95 is described below

commit 13d587a95175b837c9ee4e4029257a6569d669b8
Author: José Alberto Hernández 
<[email protected]>
AuthorDate: Wed Aug 10 12:28:16 2022 -0500

    Allow disbursementDataArray empty instead of null (#2499)
    
    Co-authored-by: Jose Alberto Hernandez <[email protected]>
---
 .../java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java     | 2 +-
 .../loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java
 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java
index 9a01bf4d9..8909db4ae 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java
@@ -1609,7 +1609,7 @@ public class Loan extends 
AbstractAuditableWithUTCDateTimeCustom {
             final JsonArray disbursementDataArray = 
command.arrayOfParameterNamed(LoanApiConstants.disbursementDataParameterName);
 
             if (loanProduct.isDisallowExpectedDisbursements()) {
-                if (disbursementDataArray != null) {
+                if (!disbursementDataArray.isEmpty()) {
                     final String errorMessage = "For this loan product, 
disbursement details are not allowed";
                     throw new 
MultiDisbursementDataNotAllowedException(LoanApiConstants.disbursementDataParameterName,
 errorMessage);
                 }
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java
 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java
index 029ca66e1..c92ff7b9a 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java
@@ -2883,7 +2883,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl 
implements LoanWritePlatf
         final JsonArray disbursementDataArray = 
command.arrayOfParameterNamed(LoanApiConstants.disbursementDataParameterName);
 
         if (isDisallowExpectedDisbursements) {
-            if (disbursementDataArray != null) {
+            if (!disbursementDataArray.isEmpty()) {
                 final String errorMessage = "For this loan product, 
disbursement details are not allowed";
                 throw new 
MultiDisbursementDataNotAllowedException(LoanApiConstants.disbursementDataParameterName,
 errorMessage);
             }

Reply via email to