You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by vo...@apache.org on 2020/06/03 08:50:59 UTC

[fineract] 01/02: FINERACT-933 Suggestion to fix ArrayIndexOutOfBoundsException

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

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

commit 8d7fa73b4621763437f293d81863606ff8d8b5fe
Author: nnatarajan <na...@gmail.com>
AuthorDate: Thu May 28 17:38:30 2020 -0600

    FINERACT-933 Suggestion to fix ArrayIndexOutOfBoundsException
---
 .../bulkimport/importhandler/client/ClientPersonImportHandler.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/client/ClientPersonImportHandler.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/client/ClientPersonImportHandler.java
index 85cf95f..15a54d0 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/client/ClientPersonImportHandler.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/client/ClientPersonImportHandler.java
@@ -150,8 +150,10 @@ public class ClientPersonImportHandler implements ImportHandler {
 
             String stateProvince=ImportHandlerUtils.readAsString(ClientPersonConstants.STATE_PROVINCE_COL, row);
             Long stateProvinceId = null;
-            if (stateProvince!=null) {
+            if (stateProvince!=null && stateProvince.isBlank()) {
                 String[] stateProvinceAr = stateProvince.split("-");
+                // Arkansas-AL <-- expected format of the cell
+                // but probably it's either an empty cell or it is missing a hyphen
                 if (stateProvinceAr[1] != null) {
                     stateProvinceId = Long.parseLong(stateProvinceAr[1]);
                 }