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

taskain 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 8a51abda7 FINERACT-1724: Added nullcheck for batch API for enhanced 
reliability
8a51abda7 is described below

commit 8a51abda7831fc64e52fb1d0bd38fb21018b18d3
Author: Arnold Galovics <[email protected]>
AuthorDate: Wed Apr 5 08:35:27 2023 +0200

    FINERACT-1724: Added nullcheck for batch API for enhanced reliability
---
 .../java/org/apache/fineract/batch/service/BatchApiServiceImpl.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/batch/service/BatchApiServiceImpl.java
 
b/fineract-provider/src/main/java/org/apache/fineract/batch/service/BatchApiServiceImpl.java
index f6d5bcfd3..5ef0458bc 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/batch/service/BatchApiServiceImpl.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/batch/service/BatchApiServiceImpl.java
@@ -146,7 +146,7 @@ public class BatchApiServiceImpl implements BatchApiService 
{
         // 1. run current node
         BatchResponse response = executeRequest(request, uriInfo);
         responseList.add(response);
-        if (response.getStatusCode() == 200) {
+        if (response.getStatusCode() != null && response.getStatusCode() == 
200) {
             requestNode.getChildRequests().forEach(childNode -> {
                 BatchRequest resolvedChildRequest;
                 try {
@@ -306,7 +306,7 @@ public class BatchApiServiceImpl implements BatchApiService 
{
         BatchResponse errResponse = new BatchResponse();
 
         for (BatchResponse res : responseList) {
-            if (!res.getStatusCode().equals(200)) {
+            if (res.getStatusCode() == null || 
!res.getStatusCode().equals(200)) {
                 errResponse.setBody("Transaction is being rolled back. First 
erroneous request: \n" + new Gson().toJson(res));
                 errResponse.setRequestId(res.getRequestId());
                 if (statusCode == -1) {

Reply via email to