diff --git a/src/main/java/com/tarento/upsmf/examsAndAdmissions/service/DataImporterService.java b/src/main/java/com/tarento/upsmf/examsAndAdmissions/service/DataImporterService.java index 67d760afb089e5f5dde03b0eade56c4edcaaa968..2334d2935656ddbcdac4c7074eb749bae4fd3488 100644 --- a/src/main/java/com/tarento/upsmf/examsAndAdmissions/service/DataImporterService.java +++ b/src/main/java/com/tarento/upsmf/examsAndAdmissions/service/DataImporterService.java @@ -86,7 +86,7 @@ public class DataImporterService { String columnName = columnNames.get(columnIndex); try { - if (currentCell != null) { // Add this null check + if (currentCell != null) { switch (currentCell.getCellType()) { case STRING: jsonObject.put(columnName, currentCell.getStringCellValue()); @@ -119,9 +119,10 @@ public class DataImporterService { } return null; }) - .filter(Objects::nonNull) // Filter out rows with null values + .filter(jsonObj -> jsonObj != null) // Filter out rows with null values .collect(Collectors.collectingAndThen(Collectors.toList(), JSONArray::new)); + return jsonArray; } }