diff --git a/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/reader/BasePartitioner.java b/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/reader/BasePartitioner.java index 659fbf88..248ed903 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/reader/BasePartitioner.java +++ b/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/reader/BasePartitioner.java @@ -166,9 +166,9 @@ void filterStudentCredentialDistribution(List cre StudentCredentialDistribution scd = (StudentCredentialDistribution)scdIt.next(); String districtCode = StringUtils.substring(scd.getSchoolOfRecord(), 0, 3); if ( - (request.getDistricts() != null && !request.getDistricts().isEmpty() && !request.getDistricts().contains(districtCode)) + (StringUtils.isNotBlank(scd.getSchoolOfRecord()) && request.getDistricts() != null && !request.getDistricts().isEmpty() && !request.getDistricts().contains(districtCode)) || - (request.getSchoolOfRecords() != null && !request.getSchoolOfRecords().isEmpty() && !request.getSchoolOfRecords().contains(scd.getSchoolOfRecord())) + (StringUtils.isNotBlank(scd.getSchoolOfRecord()) && request.getSchoolOfRecords() != null && !request.getSchoolOfRecords().isEmpty() && !request.getSchoolOfRecords().contains(scd.getSchoolOfRecord())) ) { scdIt.remove(); LOGGER.debug("Student Credential {}/{} removed by the filter \"{}\"", scd.getPen(), scd.getSchoolOfRecord(), String.join(",", request.getDistricts()));