You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by "wkigenyi (via GitHub)" <gi...@apache.org> on 2026/01/05 14:46:13 UTC

[PR] FINERACT-2432 [fineract]

wkigenyi opened a new pull request, #5288:
URL: https://github.com/apache/fineract/pull/5288

   ## Description
   
   Describe the changes made and why they were made. (Ignore if these details are present on the associated Apache Fineract JIRA ticket.)
   
   ## Checklist
   
   Please make sure these boxes are checked before submitting your pull request - thanks!
   
   - [ ] Write the commit message as per [our guidelines](https://github.com/apache/fineract/blob/develop/CONTRIBUTING.md#pull-requests)
   - [ ] Acknowledge that we will not review PRs that are not passing the build _("green")_ - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
   - [ ] Create/update [unit or integration tests](https://fineract.apache.org/docs/current/#_testing) for verifying the changes made.
   - [ ] Follow our [coding conventions](https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions).
   - [ ] Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
   - [ ] [This PR must not be a "code dump"](https://cwiki.apache.org/confluence/display/FINERACT/Pull+Request+Size+Limit). Large changes can be made in a branch, with assistance. Ask for help on the [developer mailing list](https://fineract.apache.org/#contribute).
   
   Your assigned reviewer(s) will follow our [guidelines for code reviews](https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2432: LoanProductDataValidator.validateLoanScheduleType() throws NullPointerException when loanScheduleType is null [fineract]

Posted by "wkigenyi (via GitHub)" <gi...@apache.org>.
wkigenyi commented on code in PR #5288:
URL: https://github.com/apache/fineract/pull/5288#discussion_r2676041011


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/serialization/LoanProductDataValidator.java:
##########
@@ -2797,6 +2797,9 @@ public void fixedLengthValidations(final String transactionProcessingStrategyCod
     private void validateLoanScheduleType(final String transactionProcessingStrategyCode, final DataValidatorBuilder baseDataValidator,
             final JsonElement element) {
         final String loanScheduleType = this.fromApiJsonHelper.extractStringNamed(LoanProductConstants.LOAN_SCHEDULE_TYPE, element);
+        if (loanScheduleType == null) {

Review Comment:
   According to the validation and the API docs `loanScheduleType` is not among the mandatory fields but it has a default value that is used in case it is not specified when creating a loan product ie "CUMULATIVE". I have added some tests to take care of this. I have also address a closely related issue where the loanScheduleType has an invalid value. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2432: LoanProductDataValidator.validateLoanScheduleType() throws NullPointerException when loanScheduleType is null or has an invalid value [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5288:
URL: https://github.com/apache/fineract/pull/5288#discussion_r2676052387


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/serialization/LoanProductDataValidator.java:
##########
@@ -2797,6 +2797,9 @@ public void fixedLengthValidations(final String transactionProcessingStrategyCod
     private void validateLoanScheduleType(final String transactionProcessingStrategyCode, final DataValidatorBuilder baseDataValidator,
             final JsonElement element) {
         final String loanScheduleType = this.fromApiJsonHelper.extractStringNamed(LoanProductConstants.LOAN_SCHEDULE_TYPE, element);
+        if (loanScheduleType == null) {

Review Comment:
   ```
   if (this.fromApiJsonHelper.parameterExists(LoanProductConstants.LOAN_SCHEDULE_TYPE, element)) {
               validateLoanScheduleType(transactionProcessingStrategyCode, baseDataValidator, element);
           }
   ```
   
   This is how it starts. If any value was provided for "loanScheduleType", it CANNOT be Null!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2432: LoanProductDataValidator.validateLoanScheduleType() fails silently when loanScheduleType is null or has an invalid value [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy merged PR #5288:
URL: https://github.com/apache/fineract/pull/5288


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2432: LoanProductDataValidator.validateLoanScheduleType() fails silently when loanScheduleType is null or has an invalid value [fineract]

Posted by "wkigenyi (via GitHub)" <gi...@apache.org>.
wkigenyi commented on code in PR #5288:
URL: https://github.com/apache/fineract/pull/5288#discussion_r2676957975


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/serialization/LoanProductDataValidator.java:
##########
@@ -2797,6 +2797,9 @@ public void fixedLengthValidations(final String transactionProcessingStrategyCod
     private void validateLoanScheduleType(final String transactionProcessingStrategyCode, final DataValidatorBuilder baseDataValidator,
             final JsonElement element) {
         final String loanScheduleType = this.fromApiJsonHelper.extractStringNamed(LoanProductConstants.LOAN_SCHEDULE_TYPE, element);
+        if (loanScheduleType == null) {

Review Comment:
   It looks clean but it does not sort out the issue. If `loanScheduleType` is `NULL` and it is ignored then we shall have a NullPointer issue here` if (! LoanScheduleType.PROGRESSIVE.equals(LoanScheduleType.valueOf(loanScheduleType)))` because execution did not stop even after finding the the value is null.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2432: LoanProductDataValidator.validateLoanScheduleType() fails silently when loanScheduleType is null or has an invalid value [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5288:
URL: https://github.com/apache/fineract/pull/5288#discussion_r2677011791


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/serialization/LoanProductDataValidator.java:
##########
@@ -2797,6 +2797,9 @@ public void fixedLengthValidations(final String transactionProcessingStrategyCod
     private void validateLoanScheduleType(final String transactionProcessingStrategyCode, final DataValidatorBuilder baseDataValidator,
             final JsonElement element) {
         final String loanScheduleType = this.fromApiJsonHelper.extractStringNamed(LoanProductConstants.LOAN_SCHEDULE_TYPE, element);
+        if (loanScheduleType == null) {

Review Comment:
   indeed, I guess we can keep this part
   ```
   if (loanScheduleType == null || baseDataValidator.hasError()) {
               return;
           }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2432: LoanProductDataValidator.validateLoanScheduleType() fails silently when loanScheduleType is null or has an invalid value [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5288:
URL: https://github.com/apache/fineract/pull/5288#discussion_r2676330053


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/serialization/LoanProductDataValidator.java:
##########
@@ -2797,6 +2797,9 @@ public void fixedLengthValidations(final String transactionProcessingStrategyCod
     private void validateLoanScheduleType(final String transactionProcessingStrategyCode, final DataValidatorBuilder baseDataValidator,
             final JsonElement element) {
         final String loanScheduleType = this.fromApiJsonHelper.extractStringNamed(LoanProductConstants.LOAN_SCHEDULE_TYPE, element);
+        if (loanScheduleType == null) {

Review Comment:
   I see.. in this case still i think something like this would be more appropriate:
   
   ```
   Index: fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/serialization/LoanProductDataValidator.java
   IDEA additional info:
   Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
   <+>UTF-8
   ===================================================================
   diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/serialization/LoanProductDataValidator.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/serialization/LoanProductDataValidator.java
   --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/serialization/LoanProductDataValidator.java	(revision da9cb0bf5d806ccebea344b6a27e3dc6fb0d6a5e)
   +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/serialization/LoanProductDataValidator.java	(date 1767967762849)
   @@ -2797,7 +2797,7 @@
        private void validateLoanScheduleType(final String transactionProcessingStrategyCode, final DataValidatorBuilder baseDataValidator,
                final JsonElement element) {
            final String loanScheduleType = this.fromApiJsonHelper.extractStringNamed(LoanProductConstants.LOAN_SCHEDULE_TYPE, element);
   -        baseDataValidator.reset().parameter(LoanProductConstants.LOAN_SCHEDULE_TYPE).value(loanScheduleType)
   +        baseDataValidator.reset().parameter(LoanProductConstants.LOAN_SCHEDULE_TYPE).value(loanScheduleType).ignoreIfNull()
                    .isOneOfEnumValues(LoanScheduleType.class);
    
            if (!LoanScheduleType.PROGRESSIVE.equals(LoanScheduleType.valueOf(loanScheduleType))
   
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2432: LoanProductDataValidator.validateLoanScheduleType() fails silently when loanScheduleType is null or has an invalid value [fineract]

Posted by "wkigenyi (via GitHub)" <gi...@apache.org>.
wkigenyi commented on code in PR #5288:
URL: https://github.com/apache/fineract/pull/5288#discussion_r2677207091


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/serialization/LoanProductDataValidator.java:
##########
@@ -2797,6 +2797,9 @@ public void fixedLengthValidations(final String transactionProcessingStrategyCod
     private void validateLoanScheduleType(final String transactionProcessingStrategyCode, final DataValidatorBuilder baseDataValidator,
             final JsonElement element) {
         final String loanScheduleType = this.fromApiJsonHelper.extractStringNamed(LoanProductConstants.LOAN_SCHEDULE_TYPE, element);
+        if (loanScheduleType == null) {

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2432: LoanProductDataValidator.validateLoanScheduleType() fails silently when loanScheduleType is null or has an invalid value [fineract]

Posted by "wkigenyi (via GitHub)" <gi...@apache.org>.
wkigenyi commented on code in PR #5288:
URL: https://github.com/apache/fineract/pull/5288#discussion_r2676269115


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/serialization/LoanProductDataValidator.java:
##########
@@ -2797,6 +2797,9 @@ public void fixedLengthValidations(final String transactionProcessingStrategyCod
     private void validateLoanScheduleType(final String transactionProcessingStrategyCode, final DataValidatorBuilder baseDataValidator,
             final JsonElement element) {
         final String loanScheduleType = this.fromApiJsonHelper.extractStringNamed(LoanProductConstants.LOAN_SCHEDULE_TYPE, element);
+        if (loanScheduleType == null) {

Review Comment:
   Front-end (javascript)developers sometimes think undefined and null are the same thing, and if this field is provided as null from the front end (json), it will make it as null to fineract in which case I think it should be treated as if it were not provided at all (ignored, like it is in the PR).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2432: LoanProductDataValidator.validateLoanScheduleType() fails silently when loanScheduleType is null or has an invalid value [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5288:
URL: https://github.com/apache/fineract/pull/5288#discussion_r2676332021


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/serialization/LoanProductDataValidator.java:
##########
@@ -2797,6 +2797,9 @@ public void fixedLengthValidations(final String transactionProcessingStrategyCod
     private void validateLoanScheduleType(final String transactionProcessingStrategyCode, final DataValidatorBuilder baseDataValidator,
             final JsonElement element) {
         final String loanScheduleType = this.fromApiJsonHelper.extractStringNamed(LoanProductConstants.LOAN_SCHEDULE_TYPE, element);
+        if (loanScheduleType == null) {

Review Comment:
   All the rest of the changes can be removed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2432: LoanProductDataValidator.validateLoanScheduleType() throws NullPointerException when loanScheduleType is null [fineract]

Posted by "wkigenyi (via GitHub)" <gi...@apache.org>.
wkigenyi commented on code in PR #5288:
URL: https://github.com/apache/fineract/pull/5288#discussion_r2675064577


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/serialization/LoanProductDataValidator.java:
##########
@@ -2797,6 +2797,9 @@ public void fixedLengthValidations(final String transactionProcessingStrategyCod
     private void validateLoanScheduleType(final String transactionProcessingStrategyCode, final DataValidatorBuilder baseDataValidator,
             final JsonElement element) {
         final String loanScheduleType = this.fromApiJsonHelper.extractStringNamed(LoanProductConstants.LOAN_SCHEDULE_TYPE, element);
+        if (loanScheduleType == null) {

Review Comment:
   The sole purpose of the PR is to check if the value **_null_** was provided instead of leaving it out entirely or using **_undefined_** (remember it is not a required field), and if this is the case the validate function does not proceed (returns immediately). Is an integration test necessary?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2432: LoanProductDataValidator.validateLoanScheduleType() fails silently when loanScheduleType is null or has an invalid value [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5288:
URL: https://github.com/apache/fineract/pull/5288#discussion_r2676069321


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/serialization/LoanProductDataValidator.java:
##########
@@ -2800,15 +2803,26 @@ private void validateLoanScheduleType(final String transactionProcessingStrategy
         baseDataValidator.reset().parameter(LoanProductConstants.LOAN_SCHEDULE_TYPE).value(loanScheduleType)
                 .isOneOfEnumValues(LoanScheduleType.class);
 
-        if (!LoanScheduleType.PROGRESSIVE.equals(LoanScheduleType.valueOf(loanScheduleType))
+        if (loanScheduleType == null || baseDataValidator.hasError()) {
+            return;
+        }
+
+        LoanScheduleType scheduleType;
+        try {
+            scheduleType = LoanScheduleType.valueOf(loanScheduleType);
+        } catch (IllegalArgumentException e) {
+            throw new GeneralPlatformDomainRuleException("error.msg.invalid.loan.schedule.type", "Invalid loan schedule type");
+        }
+
+        if (!LoanScheduleType.PROGRESSIVE.equals(scheduleType)

Review Comment:
   Not needed. 
   If the value is `NULL` just throw new PlatformApiDataValidationException...
   
   Something like this:
   ```
   Index: fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/serialization/LoanProductDataValidator.java
   IDEA additional info:
   Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
   <+>UTF-8
   ===================================================================
   diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/serialization/LoanProductDataValidator.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/serialization/LoanProductDataValidator.java
   --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/serialization/LoanProductDataValidator.java	(revision dff889be29032cd75f18d2d418f28989f53c3cf5)
   +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/serialization/LoanProductDataValidator.java	(date 1767962780072)
   @@ -2797,8 +2797,9 @@
        private void validateLoanScheduleType(final String transactionProcessingStrategyCode, final DataValidatorBuilder baseDataValidator,
                final JsonElement element) {
            final String loanScheduleType = this.fromApiJsonHelper.extractStringNamed(LoanProductConstants.LOAN_SCHEDULE_TYPE, element);
   -        baseDataValidator.reset().parameter(LoanProductConstants.LOAN_SCHEDULE_TYPE).value(loanScheduleType)
   -                .isOneOfEnumValues(LoanScheduleType.class);
   +        baseDataValidator.reset().parameter(LoanProductConstants.LOAN_SCHEDULE_TYPE).value(loanScheduleType).notNull();
   +        baseDataValidator.throwValidationErrors();
   +        baseDataValidator.reset().parameter(LoanProductConstants.LOAN_SCHEDULE_TYPE).value(loanScheduleType).isOneOfEnumValues(LoanScheduleType.class);
    
            if (!LoanScheduleType.PROGRESSIVE.equals(LoanScheduleType.valueOf(loanScheduleType))
                    && AdvancedPaymentScheduleTransactionProcessor.ADVANCED_PAYMENT_ALLOCATION_STRATEGY
   
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2432: LoanProductDataValidator.validateLoanScheduleType() fails silently when loanScheduleType is null or has an invalid value [fineract]

Posted by "wkigenyi (via GitHub)" <gi...@apache.org>.
wkigenyi commented on code in PR #5288:
URL: https://github.com/apache/fineract/pull/5288#discussion_r2676906305


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/serialization/LoanProductDataValidator.java:
##########
@@ -2797,6 +2797,9 @@ public void fixedLengthValidations(final String transactionProcessingStrategyCod
     private void validateLoanScheduleType(final String transactionProcessingStrategyCode, final DataValidatorBuilder baseDataValidator,
             final JsonElement element) {
         final String loanScheduleType = this.fromApiJsonHelper.extractStringNamed(LoanProductConstants.LOAN_SCHEDULE_TYPE, element);
+        if (loanScheduleType == null) {

Review Comment:
   I agree. This is clean.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2432: LoanProductDataValidator.validateLoanScheduleType() throws NullPointerException when loanScheduleType is null [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5288:
URL: https://github.com/apache/fineract/pull/5288#discussion_r2675154994


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/serialization/LoanProductDataValidator.java:
##########
@@ -2797,6 +2797,9 @@ public void fixedLengthValidations(final String transactionProcessingStrategyCod
     private void validateLoanScheduleType(final String transactionProcessingStrategyCode, final DataValidatorBuilder baseDataValidator,
             final JsonElement element) {
         final String loanScheduleType = this.fromApiJsonHelper.extractStringNamed(LoanProductConstants.LOAN_SCHEDULE_TYPE, element);
+        if (loanScheduleType == null) {

Review Comment:
   i think its required and mandatory field or it should be.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2432: LoanProductDataValidator.validateLoanScheduleType() throws NullPointerException when loanScheduleType is null [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5288:
URL: https://github.com/apache/fineract/pull/5288#discussion_r2675154994


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/serialization/LoanProductDataValidator.java:
##########
@@ -2797,6 +2797,9 @@ public void fixedLengthValidations(final String transactionProcessingStrategyCod
     private void validateLoanScheduleType(final String transactionProcessingStrategyCode, final DataValidatorBuilder baseDataValidator,
             final JsonElement element) {
         final String loanScheduleType = this.fromApiJsonHelper.extractStringNamed(LoanProductConstants.LOAN_SCHEDULE_TYPE, element);
+        if (loanScheduleType == null) {

Review Comment:
   i think its required and mandatory field.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2432: LoanProductDataValidator.validateLoanScheduleType() throws NullPointerException when loanScheduleType is null [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5288:
URL: https://github.com/apache/fineract/pull/5288#discussion_r2674010444


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/serialization/LoanProductDataValidator.java:
##########
@@ -2797,6 +2797,9 @@ public void fixedLengthValidations(final String transactionProcessingStrategyCod
     private void validateLoanScheduleType(final String transactionProcessingStrategyCode, final DataValidatorBuilder baseDataValidator,
             final JsonElement element) {
         final String loanScheduleType = this.fromApiJsonHelper.extractStringNamed(LoanProductConstants.LOAN_SCHEDULE_TYPE, element);
+        if (loanScheduleType == null) {

Review Comment:
   Having `null` value is not correct and it shall fail the validation and throw error!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org